Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ARG PYTHON_VERSION=3.8
FROM python:${PYTHON_VERSION}
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
RUN python manage.py migrate
ENV PYTHONUNBUFFERED=1
EXPOSE 8080
CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"]
Comment on lines +2 to +15
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task requirement #3 explicitly states: 'Dockerfile should contain the build stage and run stage.' This Dockerfile only has a single FROM instruction with one stage. You need to implement a multi-stage build with at least two stages - typically a build stage (using a full Python image with build tools) and a run stage (using a slim image).

8 changes: 8 additions & 0 deletions INSTRUCTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Link to my personal Docker Hub repository win an app image:
https://hub.docker.com/repository/docker/nook17n1/todoapp/tags/1.0.0/sha256-9d2dd6fd3a7f772e7e992e13936174c62d55d10b11d8bb66b70b9044539081a6

Instructions for building and running the container.
1. docker build -t todoapp:1.0.0 .
2. docker run -d -p 8080:8080 --name app todoapp:1.0.0

And then start the server in your browser (default is http://localhost:8080).
Loading