Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
run: echo "DOCKER_TAG=$(echo ${GITHUB_REF} | sed -r 's/[\/()\.]+/_/g')-${GITHUB_SHA}" >> $GITHUB_OUTPUT

- name: Build the Docker image
run: docker build . --file Dockerfile --target production --tag angular-ngrx-frontend:${{ steps.vars.outputs.DOCKER_TAG }}
run: docker build . --file Dockerfile --build-arg TARGET=production --tag angular-ngrx-frontend:${{ steps.vars.outputs.DOCKER_TAG }}

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.29.0
Expand Down
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG TARGET=production

# Stage 1: Dependencies
FROM node:24.8.0-bullseye AS dependencies

Expand Down Expand Up @@ -35,9 +37,9 @@ RUN apt-get update \
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

WORKDIR /app

Expand Down Expand Up @@ -80,8 +82,8 @@ RUN chmod 777 -R /home/node /tmp \
USER node

# Add necessary stuff to bash autocomplete
ENV PATH "$PATH:/home/node/.local/bin"
ENV XDG_RUNTIME_PATH /home/node/.tmp
ENV PATH="$PATH:/home/node/.local/bin"
ENV XDG_RUNTIME_PATH=/home/node/.tmp

RUN echo 'eval "$(thefuck --alias)"' >> /home/node/.bashrc

Expand Down Expand Up @@ -112,6 +114,3 @@ COPY --from=builder /app/dist/angular-frontend /usr/share/nginx/html
EXPOSE 80

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

# Final stage selection based on build argument
FROM ${TARGET:-development}
Loading