Skip to content

Commit b30cbc9

Browse files
authored
Merge pull request #33 from django-ve/2025_upgrades
Updated Docker docs and settings
2 parents 11a5e86 + e2c673f commit b30cbc9

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ WORKDIR /app
88
COPY . /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
1414
EXPOSE 8000
1515

1616
# Run migrations and then start the server
1717
CMD ["sh", "-c", "python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8000"]
18-

README.rst

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,26 +114,46 @@ the *Django Admin Interface* like this:
114114
Building 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

131145
Requesting the URL http://localhost:4000 with the following command:
132146

133147
::
134148

135149
$ curl localhost:4000
150+
Hello, world!
136151

137152

138153
Also you can request the URL http://localhost:4000 in your web browser
139154
you 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

docs/django_helloword_docker.png

11.3 KB
Loading

0 commit comments

Comments
 (0)