-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add browser installation to fe Dockerfile
- Loading branch information
Showing
1 changed file
with
12 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
FROM node:16 AS installer | ||
|
||
WORKDIR /frontend | ||
COPY package*.json /frontend/ | ||
RUN npm ci | ||
COPY . /frontend/ | ||
# A browser is needed for automated tests | ||
RUN apt-get update && apt-get install -y chromium | ||
ENV CHROME_BIN=/usr/bin/chromium | ||
ENV CHROME_PATH=/usr/lib/chromium/ | ||
|
||
FROM node:16 AS builder | ||
WORKDIR /frontend | ||
COPY package*.json /frontend/ | ||
COPY --from=installer /frontend /frontend | ||
|
||
RUN npm ci | ||
RUN npx ng build | ||
|
||
EXPOSE 4200 | ||
CMD ["node serve"] | ||
FROM nginx:1.12-alpine | ||
RUN rm -rf /usr/share/nginx/html/* | ||
COPY --from=builder /frontend/dist/ /usr/share/nginx/html/ | ||
COPY scripts/nginx.conf /etc/nginx/nginx.conf | ||
EXPOSE 80 |