Skip to content
Snippets Groups Projects
Dockerfile 641 B
Newer Older
# Stage 0, based on Node.js, to build and compile Angular
FROM node:8.10.0 as builder

# Copy the package.json file first in order to cache the modules
COPY ./package.json /app/package.json
WORKDIR /app
# Install npm dependencies
RUN npm install
# Copy the project
COPY . /app

# Launch postinstall script (to include crypto module)
RUN npm run postinstall

# Building the Angular app /dist 
RUN npm run build:${conf}

# Stage 1, based on Nginx, to have only the compiled app
FROM nginx

COPY --from=builder /app/dist/admin-gui /usr/share/nginx/html
RUN ls -l /usr/share/nginx/html
EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]