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
6 changes: 2 additions & 4 deletions AngularFrontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Stage 1: Build frontend
FROM node:fermium as build-stage
FROM node:18.16.0-alpine3.17 as build-stage
WORKDIR ./app
COPY ./package*.json /app/
RUN npm ci
COPY ./ /app/
# Create Angular environment files in build time based in BRANCH and BUILD args
ARG BRANCH
RUN node set-env.js $BRANCH

RUN npm run build -- --output-path=./dist/out --output-hashing=all

# Stage 2: Serve it using Ngnix
Expand Down
2 changes: 1 addition & 1 deletion AngularFrontend/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AngularFrontend

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.6.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.0.2.

## Development server

Expand Down
27 changes: 0 additions & 27 deletions AngularFrontend/set-env.js

This file was deleted.

8 changes: 2 additions & 6 deletions NodeBackend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
# An ARG declared before the FROM instruction cannot be used after the FROM
ARG TAG
FROM node:$TAG
FROM node:18.16.0-alpine3.17

# Create app directory
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
WORKDIR /home/node/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY --chown=node:node package*.json ./
# COPY --chown=node:node . .
USER node

RUN npm install

# If you are building your code for production
# RUN npm ci --only=production
RUN npm ci

# Bundle app source
COPY --chown=node:node . .
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@ If you find any bug or just want to give your feedback (remember the ⭐ ^^), **
## Version control 📝

- [v1.0](https://github.com/Inushin/dockerAngularNginxNodePostgreSQL/tree/v1.0) - Repository created - 26/06/2022
- [v2.0 - Current](https://github.com/Inushin/dockerAngularNginxNodePostgreSQL/tree/v2.0) - Update to Angular 15 - 20/04/2023
- [v2.0](https://github.com/Inushin/dockerAngularNginxNodePostgreSQL/tree/v2.0) - Update to Angular 15 - 20/04/2023
- [v2.1 - Current](https://github.com/Inushin/dockerAngularNginxNodePostgreSQL/tree/v2.1) - Update Dockerfiles and Node to Node 18.16 (Alpine) - 13/05/2023
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ services:
container_name: angularfrontend
build:
context: ./AngularFrontend
args: [BRANCH=develop]
dockerfile: ./Dockerfile
nginx:
container_name: middlenginx
Expand All @@ -17,12 +16,11 @@ services:
volumes:
- ./nginx.middle.conf:/etc/nginx/conf.d/default.conf:rw
depends_on:
- nodebackend
- backend
backend:
container_name: nodebackend
build:
context: ./NodeBackend
args: [TAG=fermium]
dockerfile: ./Dockerfile
ports:
- "3000:3000"
Expand Down