From fd31ef88f8c786794d9ffa077e6039b823ee19c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Codru=C8=9B=20Constantin=20Gu=C8=99oi?= Date: Fri, 26 Jan 2024 07:17:54 +0000 Subject: [PATCH] Add docker compose setup for easy running specs on local --- docker-compose.yml | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..47c63d1ea --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,57 @@ +--- + +version: '2.4' + +networks: + internal_network: + driver: bridge + +volumes: + bundle_data: + driver: local + postgres_data: + driver: local + +x-default-logging: &logging + logging: + options: + max-size: '12m' + max-file: '5' + driver: json-file + +services: + console: + image: ruby + command: sleep 10000000; + environment: + CI: t + PGHOST: postgres + PGUSER: administrate + PGPASSWORD: administrate + <<: *logging + networks: + - internal_network + volumes: + - .:/work + - bundle_data:/usr/local/bundle + working_dir: /work + + postgres: + image: postgres + environment: + POSTGRES_USER: administrate + POSTGRES_DB: administrate_test + POSTGRES_PASSWORD: administrate + healthcheck: + test: pg_isready -U notroot -h localhost -p 5432 -d healthcheck-db || exit 1 + interval: '10s' + retries: 20 + start_period: '10s' + timeout: '7s' + <<: *logging + networks: + - internal_network + ports: + - 5432:5432 + volumes: + - postgres_data:/var/lib/postgresql/data