Skip to content

Commit

Permalink
Merge pull request #6 from haibeey/docker-haibeey
Browse files Browse the repository at this point in the history
add: added dockerfile for docker build
  • Loading branch information
macagua authored Feb 11, 2025
2 parents 73da046 + 33d2e6b commit 8ec45c7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use an official Python runtime as a parent image
FROM python:3.6

# Set the working directory to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

CMD ["apt","install","python3-dev","python3-pip","python3-virtualenv","sqlitebrowser"]
# Install any needed packages specified in requirements.txt
RUN pip install -r requirements.txt

# Make port 8000 available to the world outside this container
EXPOSE 8000

CMD ["python3","manage.py","migrate"]
# Run app.py when the container launches
CMD ["python3", "manage.py","runserver","0.0.0.0:8000"]

15 changes: 15 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,18 @@ the *Django Admin Interface* like this:
:alt: Django Admin Interface running

Django Admin Interface running

Building with docker
====================

::

$ docker build --tag=helloworld .

::

$ docker run -p 4000:8000 helloworld

::

$ curl localhost:4000

0 comments on commit 8ec45c7

Please sign in to comment.