generated from hunvreus/flask-basics
-
Notifications
You must be signed in to change notification settings - Fork 168
Expand file tree
/
Copy pathDockerfile.app.dev
More file actions
32 lines (22 loc) · 913 Bytes
/
Dockerfile.app.dev
File metadata and controls
32 lines (22 loc) · 913 Bytes
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
FROM python:3.13-slim
ARG APP_UID=1000
ARG APP_GID=1000
# Create non-root user (keep dev/prod parity)
RUN if ! getent group "${APP_GID}" >/dev/null; then addgroup --gid "${APP_GID}" appgroup; fi \
&& adduser --uid "${APP_UID}" --gid "${APP_GID}" --system --home /app appuser
# System dependencies
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
WORKDIR /app
# Set UV cache directory and home
ENV UV_CACHE_DIR=/tmp/uv
ENV HOME=/app
# Ensure venv path is writable by appuser
RUN mkdir -p /opt/venv && chown -R "${APP_UID}:${APP_GID}" /opt/venv
# Switch to non-root user
USER appuser
EXPOSE 8000
COPY docker/entrypoint.app.dev.sh /entrypoint.app.dev.sh
COPY docker/entrypoint.worker-jobs.dev.sh /entrypoint.worker-jobs.dev.sh
COPY docker/entrypoint.worker-monitor.dev.sh /entrypoint.worker-monitor.dev.sh