Files
anyway/backend/Dockerfile
kscheidecker c81310cf8a
Some checks failed
Run testing on the backend code / Build (pull_request) Has been cancelled
Run linting on the backend code / Build (pull_request) Has been cancelled
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m33s
Build and deploy the backend to staging / Add a comment to the PR to notify about the deployment (pull_request) Successful in 7s
without alpine
2025-12-24 14:31:16 +00:00

31 lines
813 B
Docker

# use python 3.12 as a base image
FROM python:3.12-slim-bookworm
# 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