[update]添加Dockerfile

This commit is contained in:
OrangeM21
2020-05-18 13:56:31 +08:00
parent 859fff7dff
commit 2b1236f77c
3 changed files with 23 additions and 0 deletions

2
.dockerignore Normal file
View File

@@ -0,0 +1,2 @@
dist
node_modules

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM node:10 as stage-build
WORKDIR /data
ADD ./package.json /data/package.json
ADD ./yarn.lock /data/yarn.lock
RUN yarn
ADD . /data
RUN yarn build:prod
FROM nginx:alpine
COPY --from=stage-build /data/dist /opt/lina/
# COPY ./src/assets/i18n /opt/luna/i18n
COPY nginx.conf /etc/nginx/conf.d/default.conf

8
nginx.conf Normal file
View File

@@ -0,0 +1,8 @@
server {
listen 80;
location / {
try_files $uri / /index.html;
alias /opt/lina/;
}
}