-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
55 lines (41 loc) · 1.53 KB
/
Dockerfile
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
51
52
53
54
55
# Build Stage
FROM node:18-buster AS cln-app-builder
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev
# Create app directory
WORKDIR /app
# Copy project files and folders
COPY apps/backend ./apps/backend
COPY apps/frontend ./apps/frontend
COPY package.json ./
COPY package-lock.json ./
# Install dependencies
RUN npm install
# Build assets
RUN npm run build
# Prune development dependencies
RUN npm prune --omit=dev
# Final image
FROM node:18-buster-slim AS cln-app-final
# Install jq for JSON parsing in entrypoint.sh
RUN apt-get update && apt-get install -y jq socat
# Copy built code from build stages to '/app/frontend' directory
COPY --from=cln-app-builder /app/apps/frontend/build /app/apps/frontend/build
COPY --from=cln-app-builder /app/apps/frontend/public /app/apps/frontend/public
COPY --from=cln-app-builder /app/apps/frontend/package.json /app/apps/frontend/package.json
# Copy built code from build stages to '/app/backend' directory
COPY --from=cln-app-builder /app/apps/backend/dist /app/apps/backend/dist
COPY --from=cln-app-builder /app/apps/backend/package.json /app/apps/backend/package.json
# Copy built code from build stages to '/app' directory
COPY --from=cln-app-builder /app/package.json /app/package.json
COPY --from=cln-app-builder /app/node_modules /app/node_modules
# Change directory to '/app'
WORKDIR /app
COPY entrypoint.sh entrypoint.sh
ENTRYPOINT ["bash", "./entrypoint.sh"]