diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c870d0d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +ARG python_version=3.14 +FROM python:${python_version} AS builder +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir --prefix=/install -r requirements.txt + +FROM python:${python_version} +WORKDIR /app +COPY --from=builder /install /usr/local +COPY . . +ENV PYTHONUNBUFFERED=1 +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..140f875 --- /dev/null +++ b/INSTRUCTION.md @@ -0,0 +1,32 @@ +# ToDo App — Docker Instructions + +## Docker Hub Repository + +Image is available at: https://hub.docker.com/r/tanyasavenko/todoapp + +## Building the image + +1. Clone the repository: +```bash + git clone https://github.com/tanyasavenko/devops_todolist.git + cd devops_todolist +``` + +2. Build the Docker image: +```bash + docker build -t todoapp:1.0.0 . +``` + +## Running the container + +```bash +docker run -p 8080:8080 todoapp:1.0.0 +``` + +## Accessing the application + +Open your browser and navigate to: + +``` +http://localhost:8080 +``` \ No newline at end of file