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
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ARG PYTHON_VERSION=3.11

FROM python:${PYTHON_VERSION} AS builder

WORKDIR /app

COPY requirements.txt .

RUN pip install --user -r requirements.txt

Comment thread
TrickyTenshi marked this conversation as resolved.
COPY . .

FROM python:${PYTHON_VERSION}-slim

WORKDIR /app

COPY --from=builder /root/.local /root/.local

COPY --from=builder /app .

ENV PATH=/root/.local/bin:$PATH
ENV PYTHONUNBUFFERED=1

RUN python manage.py migrate

CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"]
29 changes: 29 additions & 0 deletions INSTRUCTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ToDo App Docker Instructions

1. Docker Hub Repository
The pre-built image is available at the following link:
https://hub.docker.com/r/trickykot3/todoapp

2. Build Instructions
Build for local use:

docker build -t todoapp .

Build for pushing to Docker Hub:

docker build -t trickykot3/todoapp:1.0.0 .

3. Run Instructions
Run the local image:

docker run -p 8080:8080 --name my_todo_app todoapp

Run the image from Docker Hub:

docker run -p 8080:8080 --name my_todo_app trickykot3/todoapp:1.0.0

(Note: The todoapp and trickykot3/todoapp:1.0.0 tags refer to the same build; the only difference is the naming convention for local testing vs. registry deployment.)

4. Accessing the Application
Once the container is up and running, you can access the application via your web browser at:
http://localhost:8080
Loading