diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3c6dcc8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +ARG PYTHON_VERSION=3.8-slim + +FROM python:${PYTHON_VERSION} AS Builder + +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +RUN python -m venv /app/.venv +ENV PATH=/app/.venv/bin:${PATH} + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +FROM python:${PYTHON_VERSION} AS Runner + +WORKDIR /app + +ENV PATH=/app/.venv/bin:${PATH} + +COPY --from=Builder /app/.venv /app/.venv +COPY . . + +RUN python manage.py migrate +EXPOSE 8080 + +CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"] diff --git a/INSTRUCTION.md b/INSTRUCTION.md new file mode 100644 index 0000000..e3f7114 --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,14 @@ +Image repository link: +https://hub.docker.com/repository/docker/difuz1x/todoapp/general + +to run the app: +docker pull difuz1x/todoapp:1.0.0 + +and then + +docker run -d -p 8080:8080 --name todoapp difuz1x/todoapp:1.0.0 + +after application succesfully started + +go to browser with URL: +http://localhost:8080 \ No newline at end of file