Skip to content

Commit 9648cea

Browse files
committed
feat: Update Dockerfiles #4
1 parent 5160cd7 commit 9648cea

6 files changed

Lines changed: 42 additions & 21 deletions

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","-jar","app.jar"]
19+
ENTRYPOINT ["java", "-Dspring.profiles.active=dev","-jar","app.jar"]

backend/docker-compose.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

backend/src/main/resources/application-dev.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
spring.application.name=PCTS
22

3-
spring.datasource.url=jdbc:postgresql://localhost:5432/pcts
3+
spring.datasource.url=jdbc:postgresql://pcts-dev-db:5432/pcts
44
spring.datasource.username=user
55
spring.datasource.password=pwd
66
spring.datasource.driver-class-name=org.postgresql.Driver

docker/docker-compose.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
pcts-frontend:
21+
container_name: pcts-frontend
22+
build:
23+
context: ../frontend
24+
dockerfile: ../frontend/Dockerfile
25+
ports:
26+
- "4200:80"

frontend/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ RUN npm run build -- --output-path=./dist/ --configuration=production
1212

1313
FROM nginx:alpine AS runner
1414

15+
COPY nginx.conf /etc/nginx/
16+
1517
COPY --from=builder /app/dist/browser /usr/share/nginx/html
1618

1719
EXPOSE 4200

frontend/nginx.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
event {}
2+
http {
3+
server {
4+
listen 80;
5+
server_name localhost;
6+
root /usr/share/nginx/html;
7+
index index.html;
8+
location / {
9+
try_files $uri $uri/ /index.html =404;
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)