-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
36 lines (24 loc) · 1.08 KB
/
dockerfile
File metadata and controls
36 lines (24 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Stage 1: Compile and Build angular codebase
# Use official node image as the base image
FROM node:alpine as build
# Set the working directory
WORKDIR /usr/local/app
# Add the source code to app
COPY ./ /usr/local/app/
RUN npm cache clean --force
RUN export NODE_OPTIONS=--openssl-legacy-provider && npm run build && npm install --production --ignore-scripts --prefer-offline
# Install all the dependencies
#RUN npm install
# Generate the build of the application
#RUN npm run build
# Stage 2: Serve app with nginx server
# Use official nginx image as the base image
FROM nginx:latest AS ngi
# copiar la configuración nginx para el ruteo de angular/react
#COPY /nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /usr/local/app/dist/front-yaml/assets/nginx.conf /usr/share/nginx/html
COPY --from=build /usr/local/app/dist/front-yaml/assets/nginx.conf /etc/nginx/conf.d/default.conf
# Copy the build output to replace the default nginx contents.
COPY --from=build /usr/local/app/dist/front-yaml /usr/share/nginx/html
# Expose port 80
EXPOSE 80