Skip to content

Commit

Permalink
add build environments, test actionas build process/image
Browse files Browse the repository at this point in the history
  • Loading branch information
alekszivko committed Jan 23, 2025
1 parent 2af1b00 commit 17cb2bf
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ WORKDIR /usr/src/app
#WORKDIR /usr/src/app

COPY package.json package-lock.json ./
RUN npm install
RUN npm ci
RUN npm install -g @angular/cli
COPY . .
RUN npm run build --configuration=production

FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build /usr/src/app/dist/gepardec-gamertrack-frontend/browser /usr/share/nginx/html
FROM bitnami/nginx:1.27.3-debian-12-r5
COPY nginx.conf /opt/bitnami/nginx/conf/nginx.conf
COPY --from=build /usr/src/app/dist/gepardec-gamertrack-frontend/browser /opt/bitnami/nginx/html/

CMD ["/bin/bash", "-c", "nginx -g 'daemon off;'"]
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
services:
gamertrack-database:
image: postgres
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=gepardec
- POSTGRES_USER=gamertrack
- POSTGRES_DB=gamertrack

gamertrack-backend:
image: gamertrack-war
ports:
- "8080:8080"
links:
- "gamertrack-database:gamertrack-database"
environment:
- POSTGRESQL_USER=gamertrack
- POSTGRESQL_PASSWORD=gepardec
- POSTGRESQL_URL=jdbc:postgresql://gamertrack-database/gamertrack
hostname:

gamertrack-frontend:
image: gamertrack-frontend
ports:
- "4200:80"
links:
- "gamertrack-backend:gamertrack-backend"
hostname: gamertrack-frontend
7 changes: 4 additions & 3 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
events{}

http {
include /etc/nginx/mime.types;
include /opt/bitnami/nginx/conf/mime.types.default;
server {
listen 80;
listen 8080;
server_name localhost;
root /usr/share/nginx/html;
root /opt/bitnami/nginx/html;
index index.html;

location / {
try_files $uri $uri/ /index.html;
Expand Down

0 comments on commit 17cb2bf

Please # to comment.