From c1d14c55f7ff5a84259d97d80dc64b9d1c536d52 Mon Sep 17 00:00:00 2001 From: Daniel Petrov Date: Wed, 16 Oct 2024 18:13:39 +0300 Subject: [PATCH] build(docker): add profiles and change server entrypoint --- docker-compose.yml => compose.yml | 25 ++++++++++++++++--------- entrypoint.sh | 7 +++++++ 2 files changed, 23 insertions(+), 9 deletions(-) rename docker-compose.yml => compose.yml (93%) create mode 100755 entrypoint.sh diff --git a/docker-compose.yml b/compose.yml similarity index 93% rename from docker-compose.yml rename to compose.yml index d81b84c5..6959350f 100644 --- a/docker-compose.yml +++ b/compose.yml @@ -15,13 +15,13 @@ services: - --entrypoints.web.address=:80 labels: - "traefik.enable=true" -# # Dashboard + # Dashboard - "traefik.http.routers.traefik.entrypoints=web" - "traefik.http.routers.traefik.rule=Host(`traefik.localhost`)" - "traefik.http.routers.traefik.service=api@internal" ports: # The HTTP port - - "80:80" + - "8181:80" # The Web UI (enabled by --api.insecure=true) - "8282:8080" volumes: @@ -39,6 +39,8 @@ services: server: build: . + entrypoint: ./entrypoint.sh + command: start # env_file: # - sb-server.env environment: @@ -59,6 +61,7 @@ services: - ./uploads:/app/uploads - public:/app/public - ./log:/app/log + - ./entrypoint.sh:/app/entrypoint.sh labels: - "traefik.enable=true" - "traefik.http.routers.sbserver.entrypoints=web" @@ -75,6 +78,13 @@ services: healthcheck: test: [ "CMD-SHELL", "pg_isready -h localhost | grep accepting" ] + redis: + image: redis + ports: + - "6379:6379" + healthcheck: + test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ] + testdb: image: postgres:9.4 environment: @@ -82,6 +92,8 @@ services: POSTGRES_USER: 'testuser' ports: - "5434:5432" + profiles: + - test dbadmin: image: adminer @@ -90,13 +102,8 @@ services: - testdb ports: - "8080:8080" - - redis: - image: redis - ports: - - "6379:6379" - healthcheck: - test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ] + profiles: + - tools volumes: public: diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 00000000..8c4e58f6 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +npm run enqueue organizations:export + +npm "$@"