Skip to content

Commit 8ec45c7

Browse files
authored
Merge pull request #6 from haibeey/docker-haibeey
add: added dockerfile for docker build
2 parents 73da046 + 33d2e6b commit 8ec45c7

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use an official Python runtime as a parent image
2+
FROM python:3.6
3+
4+
# Set the working directory to /app
5+
WORKDIR /app
6+
7+
# Copy the current directory contents into the container at /app
8+
COPY . /app
9+
10+
CMD ["apt","install","python3-dev","python3-pip","python3-virtualenv","sqlitebrowser"]
11+
# Install any needed packages specified in requirements.txt
12+
RUN pip install -r requirements.txt
13+
14+
# Make port 8000 available to the world outside this container
15+
EXPOSE 8000
16+
17+
CMD ["python3","manage.py","migrate"]
18+
# Run app.py when the container launches
19+
CMD ["python3", "manage.py","runserver","0.0.0.0:8000"]
20+

README.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,18 @@ the *Django Admin Interface* like this:
104104
:alt: Django Admin Interface running
105105

106106
Django Admin Interface running
107+
108+
Building with docker
109+
====================
110+
111+
::
112+
113+
$ docker build --tag=helloworld .
114+
115+
::
116+
117+
$ docker run -p 4000:8000 helloworld
118+
119+
::
120+
121+
$ curl localhost:4000

0 commit comments

Comments
 (0)