Skip to content

Commit 6d2a935

Browse files
committed
[refactor] Replace Express server with Nginx configuration and update Dockerfile for Nginx setup
1 parent 63986f0 commit 6d2a935

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ WORKDIR /app
88
COPY . .
99

1010
RUN pnpm install --frozen-lockfile
11+
RUN apk add --no-cache nginx
1112

1213
EXPOSE 80
1314

14-
CMD [ "cd /app && pnpm run build && node server.js" ]
15+
CMD [ "cd /app && pnpm run build && nginx -g 'daemon off;'" ]

nginx.conf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
server {
2+
listen 80 default_server;
3+
4+
root /app/dist;
5+
6+
# Logging
7+
access_log /dev/stdout;
8+
error_log /dev/stderr;
9+
10+
location / {
11+
try_files $uri $uri/ /index.html;
12+
}
13+
14+
# Files
15+
location ~ \.(?!html) {
16+
try_files $uri =404;
17+
}
18+
}

server.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)