diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5357ad4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +ARG PYTHON_VERSION=3.10 + + +FROM python:${PYTHON_VERSION}-slim AS builder + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + + + +FROM python:${PYTHON_VERSION}-slim + +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + + +COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages +COPY --from=builder /usr/local/bin /usr/local/bin + +COPY . . + +RUN python manage.py migrate + +CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"] \ No newline at end of file diff --git a/INSTRUCTION.md b/INSTRUCTION.md new file mode 100644 index 0000000..f22f0a8 --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,13 @@ +# ToDo App Docker +https://hub.docker.com/repository/docker/shvdw/todoapp/general +## Build image +docker build -t todoapp:1.0.0 . + +## Run container +docker run -p 8080:8080 todoapp:1.0.0 + +## Docker Hub +docker push shvdw/todoapp:1.0.0 + +## Open in browser +http://localhost:8080 \ No newline at end of file