Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG PYTHON_VERSION=3.11

FROM python:${PYTHON_VERSION} AS base

WORKDIR /app

COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install --prefix=/install -r requirements.txt

FROM python:${PYTHON_VERSION}-slim AS runner

ENV PYTHONUNBUFFERED=1

WORKDIR /app

# Copy installed packages from build stage
COPY --from=base /install /usr/local

# Copy application source code
COPY . .

# Execute database migration
RUN python manage.py migrate

EXPOSE 8080

CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"]
30 changes: 30 additions & 0 deletions INSTRUCTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Docker Hub Repository

Image is available at: [https://hub.docker.com/r/gurianov88/todoapp]

## Building the Docker Image

Clone the repository and navigate into it:

```bash
git clone https://github.com/IgorSteal/devops_todolist.git
cd devops_todolist
```

Build the image and tag it as `todoapp:1.0.0`:

```bash
docker build -t todoapp:1.0.0 .
```

## Running the Container

```bash
docker run -d -p 8080:8080 --name todoapp todoapp:1.0.0
```


## Accessing the Application

- **Landing page:** [http://localhost:8080](http://localhost:8080)
- **API browser:** [http://localhost:8080/api/](http://localhost:8080/api/)
Loading