Skip to content

Commit 6245fd4

Browse files
authored
Create Dockerfile.prod
1 parent 38ea218 commit 6245fd4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

frontend/Dockerfile.prod

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM node:20-slim AS builder
2+
WORKDIR /app
3+
4+
COPY package*.json ./
5+
RUN npm install
6+
7+
COPY . .
8+
RUN npm run build
9+
10+
11+
FROM nginx:alpine
12+
13+
COPY --from=builder /app/dist /usr/share/nginx/html
14+
15+
RUN echo 'server { \
16+
listen 80; \
17+
location / { \
18+
root /usr/share/nginx/html; \
19+
index index.html index.htm; \
20+
try_files $uri $uri/ /index.html; \
21+
} \
22+
}' > /etc/nginx/conf.d/default.conf
23+
24+
EXPOSE 80
25+
26+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)