-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from G8XSU/dockerize-2
Read application properties from env first and add Docker configuration.
- Loading branch information
Showing
7 changed files
with
101 additions
and
39 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
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,12 @@ | ||
# Use official Tomcat base image | ||
FROM tomcat:jre17 | ||
|
||
# Copy WAR file | ||
COPY app/build/libs/vss-1.0.war /usr/local/tomcat/webapps/vss.war | ||
|
||
ENV vss.jdbc.url="jdbc:postgresql://postgres:5432/postgres" | ||
ENV vss.jdbc.username=postgres | ||
ENV vss.jdbc.password=YOU_MUST_CHANGE_THIS_PASSWORD | ||
|
||
EXPOSE 8080 | ||
CMD ["catalina.sh", "run"] |
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
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,26 @@ | ||
# Application Properties File | ||
# Contains default application properties, these are meant to be changed according to application needs. | ||
# Each property can be overridden by setting an environment variable with the same name. | ||
# For example, to override 'vss.jdbc.url', set an environment variable 'vss.jdbc.url' with the new value. | ||
|
||
vss.jdbc.url=jdbc:postgresql://localhost:5432/postgres | ||
vss.jdbc.username=postgres | ||
vss.jdbc.password=YOU_MUST_CHANGE_THIS_PASSWORD | ||
|
||
# Idle Timeout | ||
vss.hikaricp.minimumIdle=10 | ||
|
||
# Set connectionTimeout to 30 secs | ||
vss.hikaricp.connectionTimeout=30000 | ||
|
||
# Set idle timeout to 10 minutes | ||
vss.hikaricp.idleTimeout=600000 | ||
|
||
# Set Maximum lifetime of a connection to 30minutes | ||
vss.hikaricp.maxLifetime=1800000 | ||
|
||
# Performance Optimizations | ||
vss.hikaricp.maxPoolSize=50 | ||
vss.hikaricp.cachePrepStmts=true | ||
vss.hikaricp.prepStmtCacheSize=250 | ||
vss.hikaricp.prepStmtCacheSqlLimit=2048 |
This file was deleted.
Oops, something went wrong.
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,33 @@ | ||
version: '3.8' | ||
services: | ||
postgres: | ||
image: postgres:15 | ||
environment: | ||
POSTGRES_DB: postgres | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: YOU_MUST_CHANGE_THIS_PASSWORD | ||
volumes: | ||
- postgres-data:/var/lib/postgresql/data | ||
- ./app/src/main/java/org/vss/impl/postgres/sql/v0_create_vss_db.sql:/docker-entrypoint-initdb.d/init.sql | ||
ports: | ||
- "5432:5432" | ||
networks: | ||
- app-network | ||
|
||
tomcat: | ||
build: | ||
context: . | ||
container_name: tomcat | ||
depends_on: | ||
- postgres | ||
ports: | ||
- "8080:8080" | ||
networks: | ||
- app-network | ||
|
||
volumes: | ||
postgres-data: | ||
|
||
networks: | ||
app-network: | ||
driver: bridge |