Skip to content

Commit c284d43

Browse files
committed
feat: Add Docker compose for backend and add environment variable #4
1 parent 9648cea commit c284d43

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ EXPOSE 8080
1616

1717
COPY --from=builder /app/target/*.jar app.jar
1818

19-
ENTRYPOINT ["java", "-Dspring.profiles.active=dev","-jar","app.jar"]
19+
ENTRYPOINT ["java", "-Dspring.profiles.active=${SPRING_PROFILE}","-jar","app.jar"]

docker/compose-backend.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
services:
3+
pcts-db:
4+
container_name: pcts-dev-db
5+
image: postgres:17
6+
restart: unless-stopped
7+
environment:
8+
POSTGRES_USER: user
9+
POSTGRES_PASSWORD: pwd
10+
POSTGRES_DB: pcts
11+
ports:
12+
- "5432:5432"
13+
pcts-backend:
14+
container_name: pcts-backend
15+
build: ../backend
16+
ports:
17+
- "8080:8080"
18+
depends_on:
19+
- pcts-db
20+
environment:
21+
SPRING_PROFILE: dev

docker/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ services:
1717
- "8080:8080"
1818
depends_on:
1919
- pcts-db
20+
environment:
21+
SPRING_PROFILE: dev
2022
pcts-frontend:
2123
container_name: pcts-frontend
2224
build:

0 commit comments

Comments
 (0)