Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 55s
Build and deploy the backend to staging / Deploy to staging (pull_request) Has been skipped
Run linting on the backend code / Build (pull_request) Successful in 2m37s
Run testing on the backend code / Build (pull_request) Failing after 1m53s
31 lines
816 B
Docker
31 lines
816 B
Docker
# use python 3.12 as a base image
|
|
FROM docker.io/python:3.12-alpine
|
|
|
|
# use the latest version of uv, independently of the python version
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
|
|
|
# Set the working directory
|
|
WORKDIR /app
|
|
|
|
# Copy uv files
|
|
COPY pyproject.toml pyproject.toml
|
|
COPY uv.lock uv.lock
|
|
COPY .python-version .python-version
|
|
|
|
# Sync the venv
|
|
RUN uv sync --frozen --no-cache --no-dev
|
|
|
|
# Copy application files
|
|
COPY src src
|
|
|
|
EXPOSE 8000
|
|
|
|
# Set environment variables used by the deployment. These can be overridden by the user using this image.
|
|
ENV NUM_WORKERS=1
|
|
ENV OSM_CACHE_DIR=/cache
|
|
ENV MEMCACHED_HOST_PATH=none
|
|
ENV LOKI_URL=none
|
|
|
|
# explicitly use a string instead of an argument list to force a shell and variable expansion
|
|
CMD uv run fastapi run src/main.py --port 8000 --workers $NUM_WORKERS
|