Skip to content

Commit 234b5f5

Browse files
committed
Updated the Docker stuffs
1 parent 8ec45c7 commit 234b5f5

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
# Use an official Python runtime as a parent image
2-
FROM python:3.6
2+
FROM python:3.11
33

44
# Set the working directory to /app
55
WORKDIR /app
66

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

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
10+
# 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
1312

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

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"]
16+
# Run migrations and then start the server
17+
CMD ["sh", "-c", "python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8000"]
2018

README.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,26 @@ the *Django Admin Interface* like this:
108108
Building with docker
109109
====================
110110

111+
Building image with the following command:
112+
111113
::
112114

113115
$ docker build --tag=helloworld .
114116

117+
118+
Running the container with the following command:
119+
115120
::
116121

117122
$ docker run -p 4000:8000 helloworld
118123

124+
125+
Requesting the URL http://localhost:4000 with the following command:
126+
119127
::
120128

121-
$ curl localhost:4000
129+
$ curl localhost:4000
130+
131+
132+
Also you can request the URL http://localhost:4000 in your web browser
133+
you can see the hello world example.

0 commit comments

Comments
 (0)