-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 944 Bytes
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 944 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.14-slim AS backend
# Install MySQL and build tools for mysqlclient, plus Node.js for frontend
RUN apt-get update && \
apt-get install -y --no-install-recommends \
default-libmysqlclient-dev build-essential pkg-config curl && \
curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
# Python dependencies
COPY backend/requirements.txt /backend/
RUN pip install --upgrade pip && pip install -r /backend/requirements.txt
# Node dependencies
COPY frontend/package*.json /frontend/
RUN npm --prefix /frontend install
# Copy all source code
COPY backend/ /backend/
COPY frontend/ /frontend/
# Collect Django static files
RUN cd backend && python manage.py collectstatic --noinput
# Entrypoint script to run backend, then frontend
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 8000 5173
ENTRYPOINT ["/entrypoint.sh"]