diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6b0ecc9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +ARG PYTHON_VERSION=3.11 + +FROM python:${PYTHON_VERSION} as base +LABEL authors="user" + +WORKDIR /app + +COPY requirements.txt . + +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +RUN python manage.py migrate + +FROM python:${PYTHON_VERSION}-slim AS run + +WORKDIR /app + +COPY --from=base /usr/local/lib/ /usr/local/lib/ +COPY --from=base /usr/local/bin/ /usr/local/bin/ +COPY --from=base /app /app + +ENV PYTHONUNBUFFERED=1 + +EXPOSE 8080 +CMD ["python", "/app/manage.py", "runserver", "0.0.0.0:8080"] diff --git a/INSTRUCTION.md b/INSTRUCTION.md new file mode 100644 index 0000000..d2be6eb --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,5 @@ +Link to Docker Hub repo: https://hub.docker.com/repository/docker/boda4ek888/todoapp/general +Instructions for building and running the container: +1. docker build -t todoapp:1.0.0 . +2. docker run -d -p 8080:8080 todoapp:1.0.0 +3. Access the application via a browser at http://localhost:8080/ \ No newline at end of file