20241113-a
This commit is contained in:
19
docker/Dockerfile.subpath
Normal file
19
docker/Dockerfile.subpath
Normal file
@@ -0,0 +1,19 @@
|
||||
# build environment
|
||||
FROM node:14 as builder
|
||||
WORKDIR /app
|
||||
ENV PATH /app/node_modules/.bin:$PATH
|
||||
ENV REACT_APP_BASE $BASE_PATH
|
||||
ENV PUBLIC_URL $BASE_PATH/admin
|
||||
COPY package.json ./
|
||||
COPY package-lock.json ./
|
||||
RUN npm install
|
||||
COPY . ./
|
||||
RUN REACT_APP_BASE=/changzhou PUBLIC_URL=/changzhou/admin GENERATE_SOURCEMAP=false node scripts/build.js
|
||||
|
||||
# production environment
|
||||
FROM nginx:stable-alpine
|
||||
COPY --from=builder /app/dist /etc/nginx/html
|
||||
COPY nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user