add ci config, add docker file
This commit is contained in:
parent
e90080e1e1
commit
21b464ae8d
18
.drone.yml
Normal file
18
.drone.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
pipeline:
|
||||||
|
build:
|
||||||
|
image: node:8
|
||||||
|
command:
|
||||||
|
- npm install
|
||||||
|
- BASE_URL=/web npm run build
|
||||||
|
when:
|
||||||
|
branch: release
|
||||||
|
docker:
|
||||||
|
image: plugins/docker
|
||||||
|
registry: docker.mtfos.xyz
|
||||||
|
repo: docker.mtfos.xyz/mtfos/bot_web
|
||||||
|
build_arg:
|
||||||
|
- PREFIX=/web
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
tags: [latest, "${DRONE_COMMIT}"]
|
||||||
|
when:
|
||||||
|
branch: release
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM nginx:alpine
|
||||||
|
LABEL maintainer="Jay <admin@trj.tw>"
|
||||||
|
ARG PREFIX
|
||||||
|
RUN mkdir -p /data
|
||||||
|
WORKDIR /data
|
||||||
|
COPY dist/ /data
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
RUN sed -i 's@\$\$prefix\$\$@'${PREFIX}'@' /etc/nginx/conf.d/default.conf
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
18
nginx.conf
Normal file
18
nginx.conf
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
#charset koi8-r;
|
||||||
|
#access_log /var/log/nginx/host.access.log main;
|
||||||
|
|
||||||
|
root /data;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location ^~ $$prefix$$/ {
|
||||||
|
alias /data/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user