mirror of
https://github.com/239573049/FastGateway.git
synced 2026-10-23 01:49:27 +08:00
3dee446b7f
Signed-off-by: Token <239573049@qq.com>
29 lines
754 B
Docker
29 lines
754 B
Docker
FROM nginx:stable-alpine AS base
|
|
WORKDIR /usr/share/nginx/html
|
|
EXPOSE 80
|
|
|
|
|
|
FROM node:alpine as builder
|
|
WORKDIR /src
|
|
COPY . .
|
|
RUN yarn config set strict-ssl false
|
|
RUN yarn config set registry https://registry.npm.taobao.org -g
|
|
RUN yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g
|
|
RUN yarn
|
|
RUN yarn build
|
|
|
|
# => Run container
|
|
FROM base AS web
|
|
WORKDIR /usr/share/nginx/html
|
|
COPY gateway.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=builder /src/build /usr/share/nginx/html/
|
|
EXPOSE 80
|
|
COPY ./env.sh .
|
|
COPY .env .
|
|
|
|
RUN echo http://mirrors.aliyun.com/alpine/v3.7/main/ >> /etc/apk/repositories
|
|
RUN apk add --no-cache bash
|
|
|
|
RUN chmod +x env.sh
|
|
|
|
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""] |