Skip to content

Commit 872fed8

Browse files
committed
feat: support docker && remove package-lock.json
1 parent 0a7067d commit 872fed8

File tree

3 files changed

+26
-22508
lines changed

3 files changed

+26
-22508
lines changed

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:16.18.0-alpine AS builder
2+
ADD . /app
3+
WORKDIR /app/
4+
RUN npm i && npm run build
5+
6+
FROM nginx:alpine-slim
7+
LABEL maintainer="诺墨"
8+
WORKDIR /var/www/html
9+
COPY --from=builder /app/build /var/www/html
10+
COPY ./default.conf /etc/nginx/conf.d/default.conf
11+
12+
EXPOSE 80

default.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
server {
2+
listen 80;
3+
server_name 127.0.0.1;
4+
5+
root /var/www/html;
6+
index index.html;
7+
8+
access_log /var/log/nginx/access.log;
9+
error_log /var/log/nginx/error.log;
10+
11+
location / {
12+
try_files $uri $uri/ /index.html?$args;
13+
}
14+
}

0 commit comments

Comments
 (0)