Skip to content

Commit 829f1ad

Browse files
MDybekWMS_BOT
authored andcommitted
Added docker-compose-prod.yml for app deployment and bumped backend d… (#12)
* Added docker-compose-prod.yml for app deployment and bumped backend dependencies. * Added GH action GitOrigin-RevId: 53a47a20660967b7d0864893db49e69fc0845359
1 parent b578c35 commit 829f1ad

4 files changed

Lines changed: 102 additions & 9 deletions

File tree

.github/workflows/copybara.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ jobs:
1616
sot_repo: WMS-DEV/StudentStats-internal
1717
destination_repo: WMS-DEV/StudentStats
1818
committer: WMS_BOT <kontakt@wmsdev.pl>
19-
push_exclude: service/src/main/resources/data/.supported_universities.csv
19+
push_exclude: |
20+
service/src/main/resources/data/.supported_universities.csv
21+
.github/workflows/docker-compose-build-push.yml
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and Push Docker Images
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Log in to GitHub Container Registry
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Build images with Docker Compose
31+
run: |
32+
set -e
33+
docker compose build
34+
35+
- name: Push images with Docker Compose
36+
run: |
37+
set -e
38+
docker compose push

docker-compose-prod.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
services:
2+
client:
3+
container_name: client
4+
image: ghcr.io/wms-dev/student-stats-client:latest
5+
restart: always
6+
build:
7+
context: ./client
8+
dockerfile: Dockerfile
9+
target: production
10+
args:
11+
- REACT_APP_SENTRY_DSN=${CLIENT_SENTRY_DSN}
12+
- REACT_APP_BACKEND_URL=${REACT_APP_BACKEND_URL}
13+
environment:
14+
- VIRTUAL_HOST=${CLIENT_HOST}
15+
- LETSENCRYPT_HOST=${CLIENT_HOST}
16+
- VIRTUAL_PORT=3000
17+
18+
server:
19+
container_name: server
20+
image: ghcr.io/wms-dev/student-stats-server:latest
21+
restart: unless-stopped
22+
build:
23+
context: ./service
24+
dockerfile: Dockerfile
25+
environment:
26+
- SERVICE_JWT_SECRET_KEY=${SERVICE_JWT_SECRET_KEY}
27+
- SERVICE_DB_URL=${SERVICE_DB_URL}
28+
- SERVICE_DB_LOGIN=${SERVICE_DB_LOGIN}
29+
- SERVICE_DB_PASSWORD=${SERVICE_DB_PASSWORD}
30+
- SERVICE_SENTRY_DSN=${SERVICE_SENTRY_DSN}
31+
- SPRING_PROFILES_ACTIVE=${SERVICE_SPRING_PROFILES_ACTIVE}
32+
- LETSENCRYPT_HOST=${SERVER_HOST}
33+
- VIRTUAL_HOST=${SERVER_HOST}
34+
- VIRTUAL_PORT=${SERVER_PORT}
35+
depends_on:
36+
- postgresdb
37+
38+
postgresdb:
39+
image: postgres:16
40+
environment:
41+
POSTGRES_USER: ${SERVICE_DB_LOGIN}
42+
POSTGRES_PASSWORD: ${SERVICE_DB_PASSWORD}
43+
POSTGRES_DB: ${SERVICE_DB_NAME}
44+
volumes:
45+
- postgres-data:/var/lib/postgresql/data
46+
47+
volumes:
48+
postgres-data:
49+
50+
networks:
51+
default:
52+
name: student-stats-network
53+
external: true

service/pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.4.4</version>
8+
<version>3.5.4</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>pl.wmsdev</groupId>
@@ -15,13 +15,13 @@
1515
<description>student_stats-backend</description>
1616
<properties>
1717
<java.version>21</java.version>
18-
<usos4j.version>1.1.6</usos4j.version>
19-
<springdoc.openapi.starter.version>2.8.6</springdoc.openapi.starter.version>
20-
<jwt.version>0.12.6</jwt.version>
21-
<jwt-api.version>0.12.6</jwt-api.version>
22-
<sentry.starter.version>8.5.0</sentry.starter.version>
23-
<opencsv.version>5.10</opencsv.version>
24-
<apache.commons.version>1.14.0</apache.commons.version>
18+
<usos4j.version>1.1.8</usos4j.version>
19+
<springdoc.openapi.starter.version>2.8.10</springdoc.openapi.starter.version>
20+
<jwt.version>0.13.0</jwt.version>
21+
<jwt-api.version>0.13.0</jwt-api.version>
22+
<sentry.starter.version>8.19.1</sentry.starter.version>
23+
<opencsv.version>5.12.0</opencsv.version>
24+
<apache.commons.version>1.14.1</apache.commons.version>
2525
</properties>
2626
<dependencies>
2727
<dependency>

0 commit comments

Comments
 (0)