-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 1.14 KB
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Build and run the server in background mode and follow the logs.
# https://docs.astral.sh/uv/guides/integration/docker/
# https://docs.astral.sh/uv/guides/integration/fastapi/
# docker build --tag=fastapi-server --no-cache --progress=plain . \
# && docker run --detach --publish=5001:5001 fastapi-server \
# && docker logs -f $(docker ps -lq)
# To kill the background container, run `docker kill $(docker ps -lq)`
# Use Astral's uv Debian Trixie Slim Python 3.12 base image
FROM ghcr.io/astral-sh/uv:python3.12-trixie-slim
RUN apt-get update && apt-get install -y build-essential
RUN uv venv && uv pip install "fastapi[standard]" pydantic pynntp beautifulsoup4 dateparser pondpond && mkdir -p /app/server
# Create a directory for the FastAPI app
WORKDIR /app
# # Copy the FastAPI app code to the container
# DO NOT DO this. Using the 'bind mount' instead (see the docker compose file).
# COPY ./server /app/server
# COPY ./static /app/static
# COPY ./templates /app/templates
# Expose port 5001
EXPOSE 5001
# Command to run the FastAPI server, binding it to port 5001
CMD ["uv", "run", "fastapi", "dev", "--host=0.0.0.0", "--port=5001", "server/main.py"]