docker-compose server postgresql et redis
This commit is contained in:
parent
69a9be3a02
commit
eff7622918
@ -0,0 +1 @@
|
||||
postgres_db: toto
|
@ -1,8 +1,10 @@
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
34626434323630303038366133623235343836353338666532653864656533623937643239313261
|
||||
3036333938613861313833303537343637386135643939640a636638363934326133386538306163
|
||||
63616464303165396338366465336335613761316261666535633730653433333465303761323837
|
||||
6261323137663035390a616438393138663039643233306233653361663435623239323639623335
|
||||
65383038306462363263623162343363613633633432333364363236633065633437623339396239
|
||||
35633137613933323635306234633262306536393536316464326431646361366438346661333234
|
||||
383930316166353338313935353133316666
|
||||
35323139356565316333376432336436666566666631363635366235316435313536373765383234
|
||||
6664623264396635643636663865626130616135326230610a373064656264323233663563623930
|
||||
38373762363331663632343036336139663833616638653361363535643239643166363435613764
|
||||
3864363664303836380a363739653638623639663262356532656262393862323164656531393531
|
||||
35663166376632663734356666306433383363386236613330663536326432306561653665356533
|
||||
64396538376432336532343366393938363963656432353638346165313836373136343433623435
|
||||
65626138633637653631386663386462623633656434363761623366626565396362663864613166
|
||||
33346136386532636132613532626133376534326339646161356461346434626335376661656534
|
||||
32343936616335376563363131643938333833376231663862333961383566666137
|
||||
|
30
server/files/docker-compose-server.yml
Normal file
30
server/files/docker-compose-server.yml
Normal file
@ -0,0 +1,30 @@
|
||||
version: "3.3"
|
||||
services:
|
||||
|
||||
db:
|
||||
image: postgres
|
||||
volumes:
|
||||
- app-db-data:/var/lib/postgresql/data/pgdata
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- PGDATA=/var/lib/postgresql/data/pgdata
|
||||
ports:
|
||||
- "54321:5432"
|
||||
|
||||
redis:
|
||||
image: redis/redis-stack-server:latest
|
||||
ports:
|
||||
- "63791:6379"
|
||||
|
||||
liquibase:
|
||||
build:
|
||||
context: ./covas-liquibase
|
||||
dockerfile: Dockerfile
|
||||
depends_on:
|
||||
- db
|
||||
command:
|
||||
- "update"
|
||||
|
||||
volumes:
|
||||
app-db-data:
|
@ -13,10 +13,37 @@
|
||||
|
||||
- name: Create directory
|
||||
file:
|
||||
path: "/home/valentin/covas-liquibase"
|
||||
path: "/home/valentin/{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- db
|
||||
- db/covas-liquibase
|
||||
|
||||
- name: Extract repo isr
|
||||
unarchive:
|
||||
src: "/tmp/covas-liquibase.tar.gz"
|
||||
dest: "/home/valentin/covas-liquibase"
|
||||
dest: "/home/valentin/db/covas-liquibase"
|
||||
|
||||
- name: Template env file
|
||||
template:
|
||||
src: env.j2
|
||||
dest: /home/valentin/db/.env
|
||||
|
||||
- name: Copy docker compose server file
|
||||
copy:
|
||||
src: docker-compose-server.yml
|
||||
dest: /home/valentin/db/docker-compose.yml
|
||||
|
||||
|
||||
- name: Stopping existing service
|
||||
community.docker.docker_compose:
|
||||
project_src: /home/valentin/db
|
||||
|
||||
- name: Starting service
|
||||
community.docker.docker_compose:
|
||||
project_src: /home/valentin/db
|
||||
register: output
|
||||
|
||||
- name: debug output
|
||||
debug:
|
||||
var: output
|
3
server/templates/env.j2
Normal file
3
server/templates/env.j2
Normal file
@ -0,0 +1,3 @@
|
||||
POSTGRES_PASSWORD={{ postgres_password }}
|
||||
POSTGRES_USER={{ postgres_user }}
|
||||
POSTGRES_DB={{ postgres_db }}
|
Loading…
x
Reference in New Issue
Block a user