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

FROM python:${PYTHON_VERSION} AS builder

WORKDIR /app

COPY . .

FROM python:${PYTHON_VERSION}-slim AS runtime

WORKDIR /app

ENV PYTHONUNBUFFERED=1

COPY --from=builder /app .

RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt && \
python manage.py migrate --noinput

EXPOSE 8080

CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"]
Comment thread
DmytroHlazyrin marked this conversation as resolved.
24 changes: 24 additions & 0 deletions INSTRUCTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Docker documentation
Docker Hub repository: https://hub.docker.com/repository/docker/dmytrohlazyrin/todoapp/general

## Build the image
```shell
docker build -t todoapp:1.0.0 .
```

## Run the container
```shell
docker run -d -p 8080:8080 --name todolistapp todoapp:1.0.0
```

## Accessing the application via a browser
```text
http://localhost:8080/
```

## Push the image to the Docker Hub

```bash
docker tag todoapp:1.0.0 dmytrohlazyrin/todoapp:1.0.0
docker push dmytrohlazyrin/todoapp:1.0.0
```
Loading