docker yeah

This commit is contained in:
dm
2025-08-26 23:13:57 +03:00
parent e491b5b19d
commit c81ba29624
2 changed files with 36 additions and 0 deletions

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM python:3.13-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
&& ln -s /root/.local/bin/uv /usr/local/bin/uv
ENV XDG_CACHE_HOME=/root/.cache \
UV_CACHE_DIR=/root/.cache/uv \
UV_LINK_MODE=copy \
PYTHONUNBUFFERED=1
WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev
COPY . .
EXPOSE 8000
CMD ["uv", "run", "uvicorn", "app.api:app", "--host", "0.0.0.0", "--port", "8000"]

13
docker-compose.yml Normal file
View File

@@ -0,0 +1,13 @@
services:
web:
build: .
container_name: sfs
command: uv run uvicorn app.api:app --host 0.0.0.0 --port 8000
ports:
- "8000:8000"
volumes:
- .:/app
- ./files:/app/files
env_file:
- .env
restart: unless-stopped