From 179c1d74db8b79b860dde2bbd84a3555db2e7e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9renger=20Dalle-Cort?= Date: Fri, 26 Apr 2024 16:45:10 -0400 Subject: [PATCH] fix(docker): move env to main yml, add names to fix db backup --- api/docker-compose.dev.yml | 4 ---- db/docker-compose.dev.yml | 8 +------- docker-compose.yml | 16 ++++++++++++++++ webui/{Dockerfile => Dockerfile.standalone} | 0 webui/docker-compose.dev.yml | 12 ++++++------ 5 files changed, 23 insertions(+), 17 deletions(-) rename webui/{Dockerfile => Dockerfile.standalone} (100%) diff --git a/api/docker-compose.dev.yml b/api/docker-compose.dev.yml index 809bf41..ac0cd1f 100644 --- a/api/docker-compose.dev.yml +++ b/api/docker-compose.dev.yml @@ -3,12 +3,8 @@ services: api: build: context: . - tags: - - "seeking/api:DEV" volumes: - .:/app/ environment: DEBUG: True restart: on-failure - ports: - - 8000:8000 diff --git a/db/docker-compose.dev.yml b/db/docker-compose.dev.yml index f5e93ff..fd92630 100644 --- a/db/docker-compose.dev.yml +++ b/db/docker-compose.dev.yml @@ -1,12 +1,6 @@ services: db: image: postgres:14 - environment: - POSTGRES_DB: seeking - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - ports: - - 5432:5432 healthcheck: # # This container can be up be not ready to accept connections, we run a healthcheck. @@ -18,7 +12,7 @@ services: # # See doc: https://docs.docker.com/reference/dockerfile/#healthcheck # - test: ["CMD-SHELL", "pg_isready -U postgres"] + test: ["CMD-SHELL", "pg_isready"] start_interval: 1s start_period: 5s interval: 5s diff --git a/docker-compose.yml b/docker-compose.yml index 24b858f..9f4c1ba 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,17 +37,26 @@ services: #-------------------------------------------------------------------------------------------- # webui: + container_name: 'seeking-webui' restart: on-failure profiles: ['webui', ''] extends: file: ./webui/docker-compose.dev.yml service: webui + build: + args: + - API_BASE_URL=http://127.0.0.1:8000 + ports: + - 3000:3000 # #-------------------------------------------------------------------------------------------- # api: + container_name: 'seeking-api' restart: on-failure profiles: ['api', ''] + ports: + - 8000:8000 environment: DATABASE_HOST: db APP_HOST: api @@ -64,11 +73,18 @@ services: #-------------------------------------------------------------------------------------------- # db: + container_name: 'seeking-db' restart: always + environment: + POSTGRES_DB: seeking + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres # profile: always active extends: file: ./db/docker-compose.dev.yml service: db + ports: + - 5432 # internal only # #-------------------------------------------------------------------------------------------- # \ No newline at end of file diff --git a/webui/Dockerfile b/webui/Dockerfile.standalone similarity index 100% rename from webui/Dockerfile rename to webui/Dockerfile.standalone diff --git a/webui/docker-compose.dev.yml b/webui/docker-compose.dev.yml index c31fc25..5d5b162 100644 --- a/webui/docker-compose.dev.yml +++ b/webui/docker-compose.dev.yml @@ -2,9 +2,9 @@ services: webui: build: context: . - tags: - - "seeking/webui:DEV" - args: - - API_BASE_URL=http://127.0.0.1:8000 - ports: - - 3000:3000 + dockerfile: Dockerfile.standalone + # + # You can override this at build time + # + # args: + # - API_BASE_URL=: