You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
692 B

# The builder from node image
FROM node:alpine as builder
# build-time variables
# prod|sandbox its value will be come from outside
ARG env=prod
RUN apk update && apk add --no-cache make git
# Move our files into directory name "app"
COPY package.json package-lock.json /app/
RUN npm install @angular/cli@6.0.8 -g
RUN cd /app && npm install
COPY . /app
# Build with $env variable from outside
RUN cd /app && npm run build
# Build a small nginx image with static website
FROM nginx:alpine
RUN rm -rf /usr/share/nginx/html/*
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /app/dist/kateb-panel /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]