-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
50 lines (38 loc) · 1.38 KB
/
Dockerfile.dev
File metadata and controls
50 lines (38 loc) · 1.38 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
# Development Dockerfile with hot reload
FROM python:3.14-slim
WORKDIR /app
# Install system dependencies including gosu for safe user switching
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
nodejs \
npm \
gosu \
git \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user for running the application
RUN groupadd -r -g 1000 appuser && \
useradd -r -u 1000 -g appuser -m -d /home/appuser -s /bin/bash appuser
# Copy and install Python dependencies as root
COPY backend/requirements.txt ./backend/
RUN pip install --no-cache-dir -r backend/requirements.txt
# Copy and install frontend dependencies as root
COPY frontend/package.json frontend/package-lock.json* ./frontend/
WORKDIR /app/frontend
RUN npm ci --legacy-peer-deps
WORKDIR /app
# Create volume mount points and set ownership
# Note: Actual volumes will be mounted here and permissions fixed at runtime
RUN mkdir -p /app/config /app/logs /data && \
chown -R appuser:appuser /app /data
# Environment
ENV PYTHONUNBUFFERED=1 \
APP_ENV=development
# Copy entrypoint script and make executable
COPY docker-entrypoint.dev.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Start as root (entrypoint will fix permissions then switch to appuser)
# This allows us to fix permissions on mounted volumes before dropping privileges
USER root
# Expose ports
EXPOSE 8080 5173
CMD ["/entrypoint.sh"]