-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
42 lines (26 loc) · 1.03 KB
/
Dockerfile
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
37
38
39
40
41
42
FROM node:20 AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci && npm install -g @angular/[email protected]
RUN apt-get update && apt-get install -y \
wget \
gnupg2 \
&& wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update \
&& apt-get install -y google-chrome-stable \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV CHROME_BIN="/usr/bin/google-chrome"
# TODO: Use cache
COPY . .
RUN npm run lint
RUN ng test --watch=false --browsers=ChromeHeadlessNoSandbox
RUN npm run build --configuration=production
FROM nginx:1.27
# RUN groupadd -g 10001 appuser && \
# useradd -u 10001 -g appuser -m appuser
COPY ./nginx.conf /etc/nginx/nginx.conf
COPY --from=build /app/dist/group4-front/browser /usr/share/nginx/html/
# COPY --from=build --chown=appuser:appuser /app/dist/group4-front/browser /usr/share/nginx/html
# USER appuser