diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ebfc099 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +ARG version=3.8-alpine +FROM python:${version} AS builder + +WORKDIR /app + +# Встановлюємо gcc та залежності для компіляції +RUN apk add --no-cache gcc musl-dev libffi-dev + +COPY requirements.txt . +RUN pip install --upgrade pip && \ + pip install --no-cache-dir -r requirements.txt + +FROM python:${version} + +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +COPY --from=builder /usr/local/lib/python3.8/site-packages \ + /usr/local/lib/python3.8/site-packages +COPY . . + +RUN python manage.py migrate + +ENTRYPOINT ["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..cdac6a8 --- /dev/null +++ b/instruction.md @@ -0,0 +1,31 @@ +# TodoApp + +## Docker Hub +https://hub.docker.com/r/igorrrrrrrrr/todoapp + +--- + +## Build image + +```bash +docker build -f Dockerfile -t todoapp . +``` + +## Run container + +```bash +docker run -d -p 8080:8080 --name todoapp igorrrrrrrrr/todoapp:1.0.0 +``` + +## Or pull from Docker Hub and run + +```bash +docker pull igorrrrrrrrr/todoapp:1.0.0 +docker run -d -p 8080:8080 --name todoapp igorrrrrrrrr/todoapp:1.0.0 +``` + +--- + +## Access the application + +Open browser and go to: \ No newline at end of file