diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..f7e53fb --- /dev/null +++ b/.drone.yml @@ -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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fae02b9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM nginx:alpine +LABEL maintainer="Jay " +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;"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..71974e8 --- /dev/null +++ b/nginx.conf @@ -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; + } +}