feat: docker 部署
parent
e6f56e4771
commit
d9e362993a
@ -0,0 +1,19 @@
|
||||
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# css
|
||||
src/**/*.css
|
||||
build
|
||||
build.zip
|
@ -0,0 +1,22 @@
|
||||
# BUILDING
|
||||
FROM node:lts-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY . ./
|
||||
COPY docker/config.prod.ts ./src/config/config.prod.ts
|
||||
RUN apk --no-cache --virtual build-dependencies add \
|
||||
python \
|
||||
make \
|
||||
g++ && \
|
||||
yarn config set registry https://registry.npm.taobao.org/ && \
|
||||
yarn install && \
|
||||
apk del build-dependencies && \
|
||||
yarn global add typescript && \
|
||||
yarn run lint && \
|
||||
SERVE_URL=http://localhost:8080 yarn run build
|
||||
|
||||
# nginx
|
||||
FROM nginx:stable-alpine
|
||||
|
||||
COPY --from=builder app/build /dolores
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
COPY docker/nginx.conf /etc/nginx/conf.d/
|
@ -0,0 +1,9 @@
|
||||
const config: IConfig = {
|
||||
serve: 'http://localhost:38080',
|
||||
keys: ['some secret hurr'],
|
||||
session: {
|
||||
key: 'koa:sess',
|
||||
},
|
||||
}
|
||||
|
||||
export default config
|
@ -0,0 +1,10 @@
|
||||
server {
|
||||
listen 38081;
|
||||
server_name localhost;
|
||||
|
||||
root /dolores;
|
||||
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue