-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·35 lines (24 loc) · 815 Bytes
/
Dockerfile
File metadata and controls
executable file
·35 lines (24 loc) · 815 Bytes
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
# Stage 1: Build the angular application
FROM node:21-alpine AS build
WORKDIR /home/app
COPY ./angular.json /home/app
COPY ./package*.json /home/app
COPY ./tsconfig*.json /home/app
COPY ./tailwind.config.js /home/app
RUN npm install
COPY ./src /home/app/src
RUN npm run build --prod
# Stage 2: Serve app with nginx server
FROM nginx:latest
# Install packages to use envsubst
RUN apt-get update && apt-get install -y gettext-base curl
# Copy the nginx template
COPY ./nginx.template /etc/nginx/templates/default.conf.template
# Copy and grant execution permissions to the entrypoint script
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Copy the build output
COPY --from=build /home/app/dist/smart-shell /usr/share/nginx/html
EXPOSE 80
# Set the entrypoint
ENTRYPOINT ["/entrypoint.sh"]