Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ARG PYTHON_VERSION=3.11

FROM python:${PYTHON_VERSION} as base
LABEL authors="user"

WORKDIR /app

COPY requirements.txt .

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

RUN python manage.py migrate

FROM python:${PYTHON_VERSION}-slim AS run

WORKDIR /app

COPY --from=base /usr/local/lib/ /usr/local/lib/
COPY --from=base /usr/local/bin/ /usr/local/bin/
COPY --from=base /app /app

ENV PYTHONUNBUFFERED=1

EXPOSE 8080
CMD ["python", "/app/manage.py", "runserver", "0.0.0.0:8080"]
5 changes: 5 additions & 0 deletions INSTRUCTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Link to Docker Hub repo: https://hub.docker.com/repository/docker/boda4ek888/todoapp/general
Instructions for building and running the container:
1. docker build -t todoapp:1.0.0 .
2. docker run -d -p 8080:8080 todoapp:1.0.0
3. Access the application via a browser at http://localhost:8080/
Loading