-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (25 loc) · 971 Bytes
/
Dockerfile
File metadata and controls
38 lines (25 loc) · 971 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
FROM node:20-bookworm-slim AS frontend-build
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
FROM node:20-bookworm-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=8333
# Keep python in runtime because frontend local API may call `python main.py` for OAuth tasks.
RUN apt-get update \
&& apt-get install -y --no-install-recommends python3 python3-requests python-is-python3 \
&& rm -rf /var/lib/apt/lists/*
COPY frontend/package.json frontend/package-lock.json /app/frontend/
RUN cd /app/frontend && npm ci --omit=dev
COPY --from=frontend-build /app/frontend/dist /app/frontend/dist
COPY . /app
RUN if [ ! -f /app/frontend/config.yaml ] && [ -f /app/frontend/config.example.yaml ]; then \
cp /app/frontend/config.example.yaml /app/frontend/config.yaml; \
fi \
&& mkdir -p /app/runtime
WORKDIR /app/frontend
EXPOSE 8333
CMD ["node", "server.js"]