generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ improve docker compose deployment + made controlpanel production i…
…mages
- Loading branch information
1 parent
a5c8a5b
commit 57c34e3
Showing
13 changed files
with
142 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
DB_USER=<POSTGRES_USER> | ||
DB_PASSWORD=<POSTGRES_PASSWORD> | ||
DB_HOST=<POSTGRES_HOST> | ||
DB_PORT=<POSTGRES_PORT> | ||
DB_USER=postgres | ||
DB_PASSWORD=postgres | ||
DB_HOST=controlpanel-db | ||
DB_PORT=5432 | ||
|
||
# Number of minutes | ||
CRON_CONFIGMANAGER=60 | ||
|
||
CONTROLPANEL_FRONTEND_URL=<FRONT_END_URL> #http://localhost:4200 | ||
CONFIGMANAGER_URL=<CONFIGMANAGER_URL> #http://localhost:3000 | ||
CONTROLPANEL_FRONTEND_URL=http://localhost:4200 | ||
CONFIGMANAGER_URL=http://configmanager:3000 |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:21 | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install -g nodemon | ||
RUN npm install | ||
|
||
COPY . . | ||
|
||
EXPOSE 8050 | ||
|
||
CMD ["nodemon", "--watch", ".", "--legacy-watch", "server.js"] |
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,25 @@ | ||
FROM node:21 | ||
FROM node:21 AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install -g @angular/cli | ||
RUN npm install | ||
RUN npm ci | ||
|
||
COPY . . | ||
|
||
EXPOSE 4200 | ||
RUN npm run build --prod | ||
|
||
CMD [ "ng", "serve", "--host", "0.0.0.0", "--port", "4200", "--poll", "1000"] | ||
FROM nginx:alpine | ||
|
||
RUN rm /etc/nginx/conf.d/default.conf | ||
|
||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
COPY --from=build /app/dist/cad/browser /usr/share/nginx/html | ||
COPY replace-env.sh /docker-entrypoint.d/99-replace-env.sh | ||
|
||
RUN chmod +x /docker-entrypoint.d/99-replace-env.sh | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
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,14 @@ | ||
FROM node:21 | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install -g @angular/cli | ||
RUN npm install | ||
|
||
COPY . . | ||
|
||
EXPOSE 4200 | ||
|
||
CMD [ "ng", "serve", "--host", "0.0.0.0", "--port", "4200", "--poll", "1000"] |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
server { | ||
listen 80; | ||
|
||
server_name localhost; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} |
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,8 @@ | ||
#!/bin/sh | ||
|
||
for file in /usr/share/nginx/html/*.js; do | ||
echo "Processing $file ..."; | ||
sed -i 's|<REPLACE_CONTROLPANEL_API_URL>|'${CONTROLPANEL_API_URL}'|g' $file | ||
done | ||
|
||
exec "$@" |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const environment = { | ||
CONTROLPANEL_API_URL: '<REPLACE_CONTROLPANEL_API_URL>', | ||
} |
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