Skip to content

Commit

Permalink
Fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Jun 18, 2024
1 parent b421f6e commit 452dea2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
1 change: 1 addition & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.venv
23 changes: 3 additions & 20 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
# Backend Dockerfile
FROM python:3.11

ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT

# Install system dependencies
RUN apt-get update && rm -rf /var/lib/apt/lists/*
RUN wget -O golang-migrate.deb https://github.com/golang-migrate/migrate/releases/download/v4.17.0/migrate.${TARGETOS}-${TARGETARCH}${TARGETVARIANT}.deb \
&& dpkg -i golang-migrate.deb \
&& rm golang-migrate.deb

# Install Poetry
RUN pip install poetry

# Set the working directory
WORKDIR /backend

# Copy only dependencies
COPY pyproject.toml poetry.lock* ./
# Copy the application
COPY . .

# Install all dependencies
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi

# Copy the rest of application code
COPY . .
RUN pip install -e .

HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --start-interval=1s --retries=3 CMD [ "curl", "-f", "http://localhost:8000/ok" ]

Expand Down

0 comments on commit 452dea2

Please sign in to comment.