-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87c4119
commit c877fd0
Showing
6 changed files
with
111 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
POSTGRES_USER=postgres | ||
POSTGRES_PASSWORD=postgres | ||
POSTGRES_DB=orservice_db |
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 |
---|---|---|
|
@@ -36,4 +36,7 @@ build/ | |
mvnw | ||
mvnw.cmd | ||
|
||
postgres-data | ||
postgres-data | ||
|
||
### env ### | ||
.env |
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,3 +1,14 @@ | ||
# Build stage | ||
FROM maven:3.8.4-openjdk-17-slim AS build | ||
WORKDIR /app | ||
COPY pom.xml . | ||
RUN mvn dependency:go-offline | ||
COPY src ./src | ||
RUN mvn clean package -DskipTests | ||
|
||
# Runtime stage | ||
FROM openjdk:17-jdk-alpine | ||
COPY target/orservice-0.0.1-SNAPSHOT.jar app-1.0.0.jar | ||
WORKDIR /app | ||
COPY --from=build /app/target/orservice-0.0.1-SNAPSHOT.jar app-1.0.0.jar | ||
EXPOSE 8080 | ||
ENTRYPOINT [ "java", "-jar", "app-1.0.0.jar", "-Dspring.profiles.active=prod" ] |
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,46 @@ | ||
services: | ||
db: | ||
container_name: orservice_db | ||
env_file: ".env" | ||
restart: on-failure | ||
image: postgres:latest | ||
ports: | ||
- "5432:5432" | ||
networks: | ||
orservice: | ||
- ipv4_address: 10.10.2.2 | ||
environment: | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
- POSTGRES_DB=${POSTGRES_DB} | ||
volumes: | ||
- ./postgres-data:/var/lib/postgresql/data | ||
- ./initdb:/docker-entrypoint-initdb.d | ||
logging: | ||
options: | ||
max-size: "10m" | ||
max-file: "3" | ||
healthcheck: | ||
test: | ||
["CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
wt: | ||
image: containrrr/watchtower | ||
labels: | ||
- "com.centurylinklabs.watchtower.scope=orservice" | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
command: --interval 30 --scope orservice | ||
|
||
volumes: | ||
postgres-data: | ||
|
||
networks: | ||
orservice: | ||
driver: bridge | ||
ipam: | ||
config: | ||
- subnet: 10.10.2.0/24 | ||
gateway: 10.10.2.1 |
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