-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdockerfile
More file actions
47 lines (32 loc) · 960 Bytes
/
dockerfile
File metadata and controls
47 lines (32 loc) · 960 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
# ========================
# Step 1: Prepare client
# ========================
FROM node:20 AS client-builder
WORKDIR /client
# Clone the client repo
RUN git clone https://github.com/PolyPixels/Holes_Client.git .
# No npm install or build needed!
# It's pure static HTML/JS/CSS
# ========================
# Step 2: Prepare server
# ========================
FROM node:20 AS server-builder
WORKDIR /app
# Clone the server repo
RUN git clone https://github.com/PolyPixels/Holes_server.git .
# Install server dependencies
RUN npm install
# Create folder structure server expects
RUN mkdir -p Holes_Client
COPY --from=client-builder /client ../Holes_Client
# ========================
# Step 3: Final production image
# ========================
FROM node:20-slim
WORKDIR /app
COPY --from=server-builder /app .
COPY --from=server-builder /Holes_Client ../Holes_Client
EXPOSE 3000
ENV PORT=3000
ENV Welcome="Welcome to Holes!"
CMD ["node", "server.js"]