-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (23 loc) · 1.12 KB
/
Copy pathDockerfile
File metadata and controls
41 lines (23 loc) · 1.12 KB
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
# ─── Stage 1: Development ────────────────────────────────────────────────────
FROM node:23-alpine AS dev
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN chown -R node:node /app
USER node
EXPOSE 4200
CMD ["npx", "ng", "serve", "--host", "0.0.0.0", "--proxy-config", "proxy.conf.json", "--poll", "2000"]
# ─── Stage 2: Build ───────────────────────────────────────────────────────────
FROM node:23-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npx ng build --configuration production
# ─── Stage 3: Production (nginx) ─────────────────────────────────────────────
FROM nginx:1.27-alpine AS prod
COPY --from=build /app/dist/tinyurl-gui/browser /usr/share/nginx/html
COPY nginx.dev.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]