-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.backend
More file actions
40 lines (31 loc) · 963 Bytes
/
Dockerfile.backend
File metadata and controls
40 lines (31 loc) · 963 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
33
34
35
36
37
38
39
40
FROM node:20-bullseye-slim
ENV DEBIAN_FRONTEND=noninteractive
ENV NODE_OPTIONS="--experimental-specifier-resolution=node"
WORKDIR /app
# Copy package manifests and install root deps (frontend build deps) with temporary proxy
COPY package*.json ./
RUN set -e; \
npm config set proxy "$PROXY"; \
npm config set https-proxy "$PROXY"; \
npm install --legacy-peer-deps; \
npm config delete proxy; \
npm config delete https-proxy;
# Backend dependencies
COPY backend/package*.json ./backend/
WORKDIR /app/backend
RUN set -e; \
npm config set proxy "$PROXY"; \
npm config set https-proxy "$PROXY"; \
npm install --legacy-peer-deps; \
npm config delete proxy; \
npm config delete https-proxy;
# Copy full source
WORKDIR /app
COPY . .
# Ensure scripts executable
RUN chmod +x /app/manage-app.sh
# Build frontend once (backend serves API only)
RUN /app/manage-app.sh build
# Expose backend port
EXPOSE 3001
CMD ["/app/manage-app.sh", "start-backend-fg"]