-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
50 lines (39 loc) · 998 Bytes
/
Copy pathdockerfile
File metadata and controls
50 lines (39 loc) · 998 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
41
42
43
44
45
46
47
48
49
50
# =========================
# Stage 1: Build compiler
# =========================
FROM ubuntu:22.04 AS compiler
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY compiler ./compiler
RUN mkdir -p compiler/build && \
cd compiler/build && \
cmake .. && \
make
# =========================
# Stage 2: Runtime (Node + same OS)
# =========================
FROM ubuntu:22.04
# Install Node.js 18 on Ubuntu
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
gcc \
g++ \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy compiler binary
COPY --from=compiler /app/compiler/build/hmscc /app/hmscc
RUN chmod +x /app/hmscc
# Copy backend
COPY backend ./backend
WORKDIR /app/backend
RUN npm ci --only=production
EXPOSE 5001
CMD ["node", "server.js"]