From 97dd156094443a64c65c4e4bd54506ab79fa4f81 Mon Sep 17 00:00:00 2001 From: Joschka Schulz Date: Wed, 2 Oct 2024 00:40:57 +0200 Subject: [PATCH 1/4] chore: update dev setting for docker --- config/database.yml | 3 ++- docker-compose.yml | 43 +++++++++++++++++++++++++++---------------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/config/database.yml b/config/database.yml index 1b008559c..cd3e6ac7a 100644 --- a/config/database.yml +++ b/config/database.yml @@ -4,7 +4,8 @@ development: &default min_messages: WARNING pool: 5 username: postgres - host: <%= ENV["POSTGRES_PORT_5432_TCP_ADDR"] || 'localhost' %> + password: <%= ENV["POSTGRES_PASSWORD"] || "INSECURE_LOCAL_DEVELOPMENT_PASSWORD" %> + host: <%= ENV["POSTGRES_PORT_5432_TCP_ADDR"] || '127.0.0.1' %> port: <%= ENV["POSTGRES_PORT_5432_TCP_PORT"] || 5432 %> test: diff --git a/docker-compose.yml b/docker-compose.yml index 796b25e27..cf3415a3c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,27 @@ -postgres: - image: postgres:9.4.1 -box: - image: busybox - volumes: - - /box -web: - build: . - ports: - - "3000:3000" - links: - - postgres - volumes: - - .:/app - volumes_from: - - box +services: + postgres: + image: postgres:14.12 + ports: + - "5432:5432" + environment: + POSTGRES_PASSWORD: INSECURE_LOCAL_DEVELOPMENT_PASSWORD + + box: + image: busybox + volumes: + - /box + + web: + build: . + ports: + - "3000:3000" + links: + - postgres + volumes: + - .:/app + volumes_from: + - box + environment: + POSTGRES_PORT_5432_TCP_ADDR: postgres + POSTGRES_PORT_5432_TCP_PORT: 5432 + POSTGRES_PASSWORD: INSECURE_LOCAL_DEVELOPMENT_PASSWORD \ No newline at end of file From 8708805f3ed7304c32b0481545f49d41f6a8b09a Mon Sep 17 00:00:00 2001 From: Joschka Schulz Date: Wed, 2 Oct 2024 00:41:36 +0200 Subject: [PATCH 2/4] chore: remove spaces from databse.yml --- config/database.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/database.yml b/config/database.yml index cd3e6ac7a..2130809ad 100644 --- a/config/database.yml +++ b/config/database.yml @@ -13,6 +13,6 @@ test: database: onruby_test production: - url: <%= ENV["DATABASE_URL"] %> + url: <%= ENV["DATABASE_URL"] %> pool: <%= ENV["DB_POOL"] || ENV["MAX_THREADS"] || 5 %> - encoding: utf8 + encoding: utf8 \ No newline at end of file From 4e6062af1b008d75ca65664a875fb98f9fe1dc91 Mon Sep 17 00:00:00 2001 From: Joschka Schulz Date: Mon, 7 Oct 2024 03:05:00 +0200 Subject: [PATCH 3/4] chore: update readme for dev setup in docker --- readme.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/readme.md b/readme.md index ec3495652..7e5615ea9 100644 --- a/readme.md +++ b/readme.md @@ -89,6 +89,15 @@ This will list links and logos to all the usergroups. ### Install locally +### On a Docker Container + +```sh +docker-compose up postgres -d + +./bin/setup +./bin/rails server +``` + ### On your machine #### Install PostgreSQL From 93c7469ae6c6cde2367aa889911fa6e0734d50df Mon Sep 17 00:00:00 2001 From: Joschka Schulz Date: Mon, 7 Oct 2024 03:05:55 +0200 Subject: [PATCH 4/4] chore: remove not suggested containers from docker compose --- docker-compose.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index cf3415a3c..9faac297b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,24 +4,4 @@ services: ports: - "5432:5432" environment: - POSTGRES_PASSWORD: INSECURE_LOCAL_DEVELOPMENT_PASSWORD - - box: - image: busybox - volumes: - - /box - - web: - build: . - ports: - - "3000:3000" - links: - - postgres - volumes: - - .:/app - volumes_from: - - box - environment: - POSTGRES_PORT_5432_TCP_ADDR: postgres - POSTGRES_PORT_5432_TCP_PORT: 5432 POSTGRES_PASSWORD: INSECURE_LOCAL_DEVELOPMENT_PASSWORD \ No newline at end of file