diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..ef0b70d3d856aaf67fc3291efca332337e168da9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,109 @@ +version: '3.8' +services: + tonality-client: + container_name: tonality-client + hostname: tonality-client + build: + context: ../tonality-client + dockerfile: Dockerfile + ports: + - "8000:5173" + depends_on: + - tonality-rest + + tonality-rest: + container_name: tonality-rest + hostname: tonality-rest + build: + context: ../tonality-rest + dockerfile: Dockerfile + env_file: + - env/tonality-rest.env + ports: + - "8001:3001" + volumes: + - ../tonality-rest/src:/tonality/tonality-rest/src # Mount source code into container (for development only) + depends_on: + tonality-rest-db: + condition: service_healthy + networks: + - backend + + tonality-rest-db: + container_name: tonality-rest-db + hostname: tonality-rest-db + image: postgres:15.4-alpine + env_file: + - env/tonality-rest-db.env + healthcheck: + test: pg_isready + timeout: 45s + interval: 10s + retries: 10 + ports: + - "8002:5432" + networks: + - backend + + tonality-soap: + container_name: tonality-soap + hostname: tonality-soap + build: + context: ../tonality-soap + dockerfile: Dockerfile + restart: always + env_file: + - env/tonality-soap.env + ports: + - "8003:8888" + volumes: + - ../tonality-soap/src:/tonality/tonality-soap/src # Mount source code into container (for development only) + depends_on: + - tonality-soap-db + networks: + - backend + + tonality-soap-db: + container_name: tonality-soap-db + hostname: tonality-soap-db + image: mysql:8.2.0 + env_file: + - env/tonality-soap-db.env + ports: + - "8004:3306" + networks: + - backend + + tonality-plain: + container_name: tonality-plain + hostname: tonality-plain + build: + context: ../tonality-plain + dockerfile: Dockerfile + env_file: + - env/tonality-plain.env + ports: + - "8005:80" + volumes: + - ../tonality-plain:/var/www/html # Mount source code into the container (for development only) + - ../tonality-plain/storage:/var/www/html/storage # Map storage directory to a volume + depends_on: + - tonality-plain-db + networks: + - backend + + tonality-plain-db: + container_name: tonality-plain-db + hostname: tonality-plain-db + image: mysql:8.2.0 + env_file: + - env/tonality-plain-db.env + volumes: + - ../tonality-plain/migrations/tonality.sql:/docker-entrypoint-initdb.d/tonality.sql:ro + ports: + - "8006:3306" + networks: + - backend + +networks: + backend: diff --git a/env/tonality-plain-db.env.example b/env/tonality-plain-db.env.example new file mode 100644 index 0000000000000000000000000000000000000000..1e50dca9447873ff2e6456c1dc703bf3646e7cdd --- /dev/null +++ b/env/tonality-plain-db.env.example @@ -0,0 +1,6 @@ +DB_HOST=db +MYSQL_USER= +MYSQL_PASSWORD= +MYSQL_ROOT_PASSWORD= +MYSQL_DATABASE= +MYSQL_PORT=3306 \ No newline at end of file diff --git a/env/tonality-plain.env.example b/env/tonality-plain.env.example index 1e50dca9447873ff2e6456c1dc703bf3646e7cdd..2d1cf7aee5699b81042f5cd26494e97950fca329 100644 --- a/env/tonality-plain.env.example +++ b/env/tonality-plain.env.example @@ -1,6 +1,10 @@ -DB_HOST=db -MYSQL_USER= -MYSQL_PASSWORD= -MYSQL_ROOT_PASSWORD= -MYSQL_DATABASE= -MYSQL_PORT=3306 \ No newline at end of file +API_KEY= + +SOAP_URL= +SOAP_WS_URL= +SOAP_API_KEY= + +REST_URL= +REST_API_KEY= +REST_USERNAME= +REST_PASSWORD= \ No newline at end of file diff --git a/env/tonality-rest-db.env.example b/env/tonality-rest-db.env.example new file mode 100644 index 0000000000000000000000000000000000000000..08926877662fbbcb7caeab67484f03394099831c --- /dev/null +++ b/env/tonality-rest-db.env.example @@ -0,0 +1,3 @@ +POSTGRES_USER= +POSTGRES_PASSWORD= +POSTGRES_DB= \ No newline at end of file diff --git a/env/tonality-rest.env.example b/env/tonality-rest.env.example new file mode 100644 index 0000000000000000000000000000000000000000..57d600538a76dae242c793090a54f502776a8b6a --- /dev/null +++ b/env/tonality-rest.env.example @@ -0,0 +1,10 @@ +EXPRESS_PORT= +JWT_SHARED_SECRET= +DATABASE_URL= + +SOAP_URL= +SOAP_WS_URL= +SOAP_API_KEY= + +PHP_URL= +PHP_API_KEY= diff --git a/env/tonality-soap-db.env.example b/env/tonality-soap-db.env.example new file mode 100644 index 0000000000000000000000000000000000000000..9b74bba1152214446f48ea7b6550ca9560f6687f --- /dev/null +++ b/env/tonality-soap-db.env.example @@ -0,0 +1,2 @@ +MYSQL_ROOT_PASSWORD= +MYSQL_DATABASE= \ No newline at end of file diff --git a/env/tonality-soap.env.example b/env/tonality-soap.env.example new file mode 100644 index 0000000000000000000000000000000000000000..ece54182a4e5737365bb95bc64a59cda77b6921b --- /dev/null +++ b/env/tonality-soap.env.example @@ -0,0 +1,5 @@ +DATABASE_URL= +DATABASE_USERNAME= +DATABASE_PASSWORD= +API_KEY= +EXPIRATION_DAYS= \ No newline at end of file