File tree Expand file tree Collapse file tree 3 files changed +24
-5
lines changed Expand file tree Collapse file tree 3 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,10 @@ WORKDIR /app
88COPY . /app
99
1010# Install necessary packages and any needed packages specified in requirements.txt
11- RUN apt-get update && apt-get install -y python3-dev python3-pip && pip install -r requirements.txt
11+ RUN apt-get update && apt-get install -y python3-dev python3-pip sqlite3 && pip install -r requirements.txt
1212
1313# Make port 8000 available to the world outside this container
1414EXPOSE 8000
1515
1616# Run migrations and then start the server
1717CMD ["sh" , "-c" , "python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8000" ]
18-
Original file line number Diff line number Diff line change @@ -114,26 +114,46 @@ the *Django Admin Interface* like this:
114114Building with docker
115115====================
116116
117- Building image with the following command:
117+ Building `` helloworld `` image with the following command:
118118
119119::
120120
121121 $ docker build --tag=helloworld .
122122
123123
124- Running the container with the following command:
124+ Running the `` django-helloworld `` container with the following command:
125125
126126::
127127
128- $ docker run -p 4000:8000 helloworld
128+ $ docker run docker run -p 4000:8000 --name django-helloworld -d helloworld
129+
130+
131+ Checking the ``django-helloworld `` logs with the following command:
132+
133+ ::
134+
135+ $ docker logs -f django-helloworld
136+
137+
138+ Stoping the ``django-helloworld `` container with the following command:
139+
140+ ::
141+
142+ $ docker stop django-helloworld
129143
130144
131145Requesting the URL http://localhost:4000 with the following command:
132146
133147::
134148
135149 $ curl localhost:4000
150+ Hello, world!
136151
137152
138153Also you can request the URL http://localhost:4000 in your web browser
139154you can see the hello world example.
155+
156+ .. figure :: https://github.com/django-ve/django-helloworld/raw/master/docs/django_helloword_docker.png
157+ :width: 315px
158+ :align: center
159+ :alt: A Django 'Hello World' example from a Docker container
You can’t perform that action at this time.
0 commit comments