docker-compose is back with both backend & database

This commit is contained in:
Michał Michaluk
2018-03-04 23:13:55 +01:00
parent 1d9cd3b42d
commit efee8c58a4
6 changed files with 35 additions and 20 deletions

6
app-monolith/Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM openjdk:8u151-jdk-alpine3.7
MAINTAINER Michał Michaluk <michal.michaluk@bottega.com.pl>
EXPOSE 8080
ADD target/*.jar app.jar
ENTRYPOINT ["java", "-jar","/app.jar", "--spring.profiles.active=docker"]

View File

@@ -0,0 +1,3 @@
spring.datasource.url=jdbc:postgresql://database:5432/postgres
spring.datasource.username=postgres
spring.datasource.password=postgres

View File

@@ -3,7 +3,7 @@ spring.jpa.database=default
spring.jpa.generate-ddl=false
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
spring.datasource.username=postgres
spring.datasource.password=
spring.datasource.password=postgres
spring.datasource.driver-class-name=org.postgresql.Driver
liquibase.change-log=classpath:/schema/db.changelog.xml
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n

View File

@@ -1,18 +0,0 @@
Aggregate Persistence:
1) normalisation of aggregate entities (Daily Demand)
2) optimistic force increment
3) mapper (Daily Demand)
4) wrapper (Product Demand)
5) event sourcing (Product Demand)
Rest:
1) crud for json document
2) query calculated
2') query for pre-calculated projection
3) naive REST aggregate commands
4) command based rest
5) application domain
6) Eventual consistency
Read your own writes (E-tag, Expect, Retry-After)

24
docker-compose.yml Normal file
View File

@@ -0,0 +1,24 @@
version: '3'
services:
backend:
build:
context: ./app-monolith/
ports:
- "8080:8080"
links:
- database
database:
image: postgres:10
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
volumes:
- data:/var/lib/postgresql/data
volumes:
data:
driver: local