diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6ab4962 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +ARG PYTHON_VERSION=3.9-slim +FROM python:${PYTHON_VERSION} AS builder + + +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --no-cache-dir --prefix=/install -r requirements.txt + +FROM python:${PYTHON_VERSION} + +ENV PYTHONUNBUFFERED=1 + +COPY --from=builder /install /usr/local +COPY . . + +RUN python manage.py migrate + +EXPOSE 8080 +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..fdf0c23 --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,10 @@ +# ToDo App Docker Instructions +"Open http//:localhost:8080 in your browser" +## Docker Hub +Link to image: https://hub.docker.com/repository/docker/dianahorban/todoapp/general +## Build and Run +```bash +# Build image +docker build -t todoapp . +# Run container +docker run -d -p 8080:8080 todoapp