Add postgresql support to pom, create sample stack 4 docker
This commit is contained in:
parent
abec14663e
commit
218fa6553e
7 changed files with 90 additions and 3 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
||||||
postgres/docker-compose.yml
|
docker/deloyment-example/files/library/*
|
||||||
|
docker/deloyment-example/files/postgresql/*
|
||||||
|
docker/deloyment-example/files/root/*
|
||||||
target/
|
target/
|
||||||
lib/
|
lib/
|
12
.vscode/launch.json
vendored
12
.vscode/launch.json
vendored
|
@ -2,13 +2,23 @@
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"type": "java",
|
"type": "java",
|
||||||
"name": "Spring Boot-MarinescoApplication<marinesco>",
|
"name": "Marinesco DEV",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"mainClass": "ru.redrise.marinesco.MarinescoApplication",
|
"mainClass": "ru.redrise.marinesco.MarinescoApplication",
|
||||||
"projectName": "marinesco",
|
"projectName": "marinesco",
|
||||||
"args": "",
|
"args": "",
|
||||||
"envFile": "${workspaceFolder}/.env"
|
"envFile": "${workspaceFolder}/.env"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Marinesco PROD",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"mainClass": "ru.redrise.marinesco.MarinescoApplication",
|
||||||
|
"projectName": "marinesco",
|
||||||
|
"args": "--spring.profiles.active=prod",
|
||||||
|
"envFile": "${workspaceFolder}/.env"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
5
docker/deloyment-example/README.MD
Normal file
5
docker/deloyment-example/README.MD
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
### How to
|
||||||
|
1. Place `marinesco.jar` to `files/root/`. Rename artifact if needed.
|
||||||
|
2. Extract `inpx`-file-containing folder into `files/library/`
|
||||||
|
3. Optionally remove `pgadmin` section from `docker-compose.yml` file
|
||||||
|
4. Run via `docker compose up`
|
9
docker/deloyment-example/build/Dockerfile
Normal file
9
docker/deloyment-example/build/Dockerfile
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
FROM openjdk:21-jdk-slim
|
||||||
|
|
||||||
|
ENV TZ=Europe/Moscow
|
||||||
|
|
||||||
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
|
WORKDIR /root
|
||||||
|
|
||||||
|
CMD java -jar marinesco.jar
|
34
docker/deloyment-example/docker-compose.yml
Normal file
34
docker/deloyment-example/docker-compose.yml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
version: '3.1'
|
||||||
|
|
||||||
|
services:
|
||||||
|
marinesco:
|
||||||
|
build: ./build
|
||||||
|
image: loper:marinesco
|
||||||
|
links:
|
||||||
|
- postgres
|
||||||
|
ports:
|
||||||
|
- 80:8080
|
||||||
|
volumes:
|
||||||
|
- ./files/root:/root
|
||||||
|
- ./files/library:/library
|
||||||
|
environment:
|
||||||
|
- SPRING_PROFILES_ACTIVE=prod
|
||||||
|
logging:
|
||||||
|
driver: syslog
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
volumes:
|
||||||
|
- ./files/postgresql:/var/lib/postgresql
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=mari
|
||||||
|
- POSTGRES_PASSWORD=example
|
||||||
|
- POSTGRES_DB=marinesco
|
||||||
|
pgadmin:
|
||||||
|
image: dpage/pgadmin4
|
||||||
|
links:
|
||||||
|
- postgres
|
||||||
|
ports:
|
||||||
|
- 3334:80
|
||||||
|
environment:
|
||||||
|
- PGADMIN_DEFAULT_EMAIL=root@srv.lan
|
||||||
|
- PGADMIN_DEFAULT_PASSWORD=example
|
6
pom.xml
6
pom.xml
|
@ -80,6 +80,12 @@
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
21
src/main/resources/application-prod.yml
Normal file
21
src/main/resources/application-prod.yml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
spring:
|
||||||
|
thymeleaf:
|
||||||
|
cache: true
|
||||||
|
datasource:
|
||||||
|
driver-class-name: org.postgresql.Driver
|
||||||
|
url: jdbc:postgresql://postgres:5432/marinesco
|
||||||
|
username: mari
|
||||||
|
password: example
|
||||||
|
jpa:
|
||||||
|
properties:
|
||||||
|
hibernate:
|
||||||
|
database-platform: org.hibernate.dialect.PostgreSQL94Dialect
|
||||||
|
hibernate:
|
||||||
|
ddl-auto: update
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
org:
|
||||||
|
springframework: INFO
|
||||||
|
marinesco:
|
||||||
|
library:
|
||||||
|
filesLocation: "/library"
|
Loading…
Reference in a new issue