diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2e2ea00 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +ARG PYTHON_VERSION=3.11 + +#build stage +FROM python:${PYTHON_VERSION}-slim AS builder + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --user -r requirements.txt + +#run stage +FROM python:${PYTHON_VERSION}-slim + +WORKDIR /app + +ENV PYTHONUNBUFFERED=1 +ENV PATH="/root/.local/bin:$PATH" + +COPY --from=builder /root/.local /root/.local +COPY . . + +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..f5848b3 --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,33 @@ +# ToDo App — Docker Instructions + +## Docker Hub Repository + +https://hub.docker.com/r/ten4i/todoapp + +## Build the image + +```bash +docker build -t ten4i/todoapp:1.0.0 . +``` + +## Run the container + +```bash +docker run -d -p 8080:8080 todoapp:1.0.0 +``` + +## Access the application + +Open your browser and go to: + +``` +http://localhost:8080 +``` + +## Pull and run from Docker Hub + +```bashas +docker push ten4i/todoapp:1.0.0 +docker Pull ten4i/todoapp:1.0.0 +docker run -d -p 8080:8080 ten4i/todoapp:1.0.0 +```