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
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ARG PYTHON_VERSION=3.8
FROM python:${PYTHON_VERSION} AS base
WORKDIR /app
COPY . .
ENV PATH="/venv/bin:$PATH"
RUN python -m venv /venv && \
pip install -r requirements.txt && \
python manage.py migrate

FROM python:${PYTHON_VERSION}-slim
ENV PYTHONUNBUFFERED=1
ENV PATH="/venv/bin:$PATH"
WORKDIR /app
COPY --from=base /venv /venv
COPY --from=base /app /app
EXPOSE 8080
ENTRYPOINT ["python", "manage.py", "runserver"]
CMD ["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 @@
## Link to Docker Hub repository

https://hub.docker.com/repository/docker/vadk1m/todoapp/general

## How to build and run the app

To build the image, run the following command:

```bash
docker build -t todoapp:1.0.0 .
```

To run the built image, execute the following command:

```bash
docker run -p 8080:8080 todoapp:1.0.0
```

Alternatively, pull the image from the Docker Hub repository and run the container:

```bash
docker pull vadk1m/todoapp:1.0.0
docker run -p 8080:8080 vadk1m/todoapp:1.0.0
```

## How to access the app

- http://localhost:8080/ - landing page
- http://localhost:8080/api/ - API page
Loading