diff --git a/ INSTRUCTION.md b/ INSTRUCTION.md new file mode 100644 index 0000000..b814ffd --- /dev/null +++ b/ INSTRUCTION.md @@ -0,0 +1,9 @@ +# ToDo App Docker +## Docker Hub +https://hub.docker.com/r/oleksijlyashenko1/todoapp +## Build +docker build -t todoapp . +## Run +docker run -p 8080:8080 todoapp +## Access +http://localhost:8080 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..875fb9c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +ARG PYTHON_VERSION=3.10 +FROM python:${PYTHON_VERSION}-slim AS builder +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir --prefix=/install -r requirements.txt + +FROM python:${PYTHON_VERSION}-slim +WORKDIR /app +COPY --from=builder /install /usr/local +COPY . /app + +RUN python manage.py migrate +ENV PYTHONUNBUFFERED=1 +CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"] \ No newline at end of file