-
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.
Merge pull request #946 from gisaia/feature/refactorBuild
Feat: refactor release script
- Loading branch information
Showing
50 changed files
with
682 additions
and
1,051 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
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
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
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
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,47 +1,48 @@ | ||
|
||
### STAGE 1: Build ### | ||
|
||
# We label our stage as 'builder' | ||
FROM node:18.20.5 AS builder | ||
ARG WORKSPACE | ||
|
||
COPY ./packages/cloud/package-docker.json ./package.json | ||
|
||
RUN npm set progress=false && npm config set depth 0 && npm cache clean --force | ||
|
||
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build | ||
RUN npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app | ||
|
||
COPY ./scripts/start.sh ./ng-app | ||
COPY ./scripts/fetch-conf-by-http.sh ./ng-app | ||
|
||
RUN mkdir /ng-app | ||
WORKDIR /ng-app | ||
|
||
COPY . . | ||
COPY packages/$WORKSPACE ./packages/$WORKSPACE/ | ||
COPY package.json . | ||
COPY package-lock.json . | ||
COPY ./src/ ./src/ | ||
COPY angular.json . | ||
COPY tsconfig.json . | ||
|
||
## Build the angular app in production mode and store the artifacts in <dist folder> | ||
RUN npm run build-cloud | ||
RUN npm install --ignore-scripts --workspace=packages/$WORKSPACE --include-workspace-root=true && npm run postinstall | ||
## Build the angular app in production mode and store the artifacts in dist folder | ||
RUN npm run build-$WORKSPACE | ||
|
||
### STAGE 2: Setup ### | ||
|
||
FROM nginx:1.25.3-alpine3.18-slim | ||
ARG version="latest" | ||
RUN chown -R nginx /etc/nginx | ||
RUN chown -R nginx /usr/share/nginx/html | ||
USER nginx | ||
|
||
LABEL io.arlas.wui.version=${version} | ||
LABEL vendor="Gisaïa" | ||
LABEL description="This container build and serve the ARLAS-wui app" | ||
|
||
RUN apk add --update bash jq netcat-openbsd curl && rm -rf /var/cache/apk/* | ||
|
||
## Copy our default nginx config | ||
COPY nginx/default.conf /etc/nginx/conf.d/ | ||
COPY nginx/nginx.conf /etc/nginx/nginx.conf | ||
|
||
## Remove default nginx website | ||
RUN rm -rf /usr/share/nginx/html/* | ||
|
||
COPY ./scripts/start.sh /usr/share/nginx/ | ||
|
||
## From 'builder' stage copy over the artifacts in dist folder to default nginx public folder | ||
COPY --from=builder /ng-app/dist /usr/share/nginx/html | ||
COPY --from=builder /ng-app/start.sh /usr/share/nginx/ | ||
COPY --from=builder /ng-app/fetch-conf-by-http.sh /usr/share/nginx/ | ||
|
||
HEALTHCHECK CMD curl --fail http://localhost:80/ || exit 1 | ||
HEALTHCHECK CMD wget -O /dev/null http://127.0.0.1:8080/ || exit 1 | ||
|
||
CMD /usr/share/nginx/start.sh |
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -10,6 +10,6 @@ | |
"." | ||
], | ||
"lib": { | ||
"entryFile": "src/public-api.opensource.ts" | ||
"entryFile": "src/public-api.ts" | ||
} | ||
} |
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,6 +1,6 @@ | ||
server { | ||
|
||
listen 80; | ||
listen 8080; | ||
|
||
sendfile on; | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
user nginx; | ||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log notice; | ||
pid /tmp/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
client_body_temp_path /tmp/client_temp; | ||
proxy_temp_path /tmp/proxy_temp_path; | ||
fastcgi_temp_path /tmp/fastcgi_temp; | ||
uwsgi_temp_path /tmp/uwsgi_temp; | ||
scgi_temp_path /tmp/scgi_temp; | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
|
||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
} |
Oops, something went wrong.