Skip to content

Commit f15cd2b

Browse files
committed
refactor: update Dockerfiles to Node 18.16 and remove un needed code
1 parent c296bb4 commit f15cd2b

File tree

5 files changed

+6
-41
lines changed

5 files changed

+6
-41
lines changed

AngularFrontend/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Stage 1: Build frontend
2-
FROM node:fermium as build-stage
2+
FROM node:18.16.0-alpine3.17 as build-stage
33
WORKDIR ./app
44
COPY ./package*.json /app/
55
RUN npm ci
66
COPY ./ /app/
7-
# Create Angular environment files in build time based in BRANCH and BUILD args
8-
ARG BRANCH
9-
RUN node set-env.js $BRANCH
7+
108
RUN npm run build -- --output-path=./dist/out --output-hashing=all
119

1210
# Stage 2: Serve it using Ngnix

AngularFrontend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AngularFrontend
22

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

55
## Development server
66

AngularFrontend/set-env.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

NodeBackend/Dockerfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
# An ARG declared before the FROM instruction cannot be used after the FROM
2-
ARG TAG
3-
FROM node:$TAG
1+
FROM node:18.16.0-alpine3.17
42

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

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

1612
RUN npm install
1713

1814
# If you are building your code for production
19-
# RUN npm ci --only=production
15+
RUN npm ci
2016

2117
# Bundle app source
2218
COPY --chown=node:node . .

docker-compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ services:
55
container_name: angularfrontend
66
build:
77
context: ./AngularFrontend
8-
args: [BRANCH=develop]
98
dockerfile: ./Dockerfile
109
nginx:
1110
container_name: middlenginx
@@ -17,12 +16,11 @@ services:
1716
volumes:
1817
- ./nginx.middle.conf:/etc/nginx/conf.d/default.conf:rw
1918
depends_on:
20-
- nodebackend
19+
- backend
2120
backend:
2221
container_name: nodebackend
2322
build:
2423
context: ./NodeBackend
25-
args: [TAG=fermium]
2624
dockerfile: ./Dockerfile
2725
ports:
2826
- "3000:3000"

0 commit comments

Comments
 (0)