-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (36 loc) · 1.12 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (36 loc) · 1.12 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM python:3.13-slim AS builder
WORKDIR /app
# Install system dependencies for building
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install poetry
RUN pip install poetry
# Copy poetry files
COPY pyproject.toml poetry.lock ./
# Configure poetry to install in system
RUN poetry config virtualenvs.create false
# Install dependencies
RUN poetry install --only=main --no-root
# Final stage
FROM python:3.13-slim
WORKDIR /app
# Install only runtime dependencies
RUN apt-get update && apt-get install -y \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Copy installed packages from builder stage
COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
# Copy application code
COPY dcfs/ ./dcfs/
COPY asgidav/ ./asgidav/
COPY main.py ./
# Create non-root user
RUN useradd --create-home --shell /bin/bash dcfs
USER dcfs
# Expose WebDAV and other protocol ports
EXPOSE 1900 2121 2022 4445
ENV DCFS_DATA_DIR=/home/dcfs/.dcfs
# Run the application
CMD ["python", "main.py"]