# Copyright 2018 Google Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. version: "3" volumes: db_data: services: db: image: mysql:8.0 environment: MYSQL_ROOT_PASSWORD: "root" MYSQL_DATABASE: crmint_development MYSQL_USER: crmint MYSQL_PASSWORD: crmint volumes: - db_data:/var/lib/mysql healthcheck: test: > /usr/bin/mysql --user=root --password=root --execute "SHOW DATABASES;" start_period: 5s interval: 2s timeout: 60s retries: 30 pubsub: build: context: ./backend/pubsub dockerfile: Dockerfile jobs: build: context: ./backend dockerfile: jobs.Dockerfile ports: - "8081:8081" volumes: - ./backend:/app - ~/.config/gcloud:/root/.config/gcloud environment: GOOGLE_CLOUD_PROJECT: $GOOGLE_CLOUD_PROJECT PUBSUB_EMULATOR_HOST: pubsub:8432 PUBSUB_PROJECT_ID: $GOOGLE_CLOUD_PROJECT PUBSUB_VERIFICATION_TOKEN: CRMintPubSubVerificationToken FLASK_ENV: development FLASK_DEBUG: 1 PORT: 8081 command: > flask run --host 0.0.0.0 --port 8081 depends_on: pubsub: condition: service_started controller: build: context: ./backend dockerfile: controller.Dockerfile ports: - "8080:8080" volumes: - ./backend:/app - ~/.config/gcloud:/root/.config/gcloud environment: APP_TITLE: Local App NOTIFICATION_SENDER_EMAIL: [email protected] SERVICE_ACCOUNT_EMAIL: [email protected] GOOGLE_CLOUD_PROJECT: $GOOGLE_CLOUD_PROJECT PUBSUB_EMULATOR_HOST: pubsub:8432 PUBSUB_PROJECT_ID: $GOOGLE_CLOUD_PROJECT PUBSUB_VERIFICATION_TOKEN: CRMintPubSubVerificationToken DATABASE_URI: > mysql+mysqlconnector://crmint:crmint@db:3306/crmint_development FLASK_ENV: development FLASK_DEBUG: 1 SQLALCHEMY_ECHO: 1 PORT: 8080 entrypoint: [] command: /bin/bash -c "python setup_pubsub.py && flask run --host 0.0.0.0 --port 8080" depends_on: db: condition: service_healthy pubsub: condition: service_started jobs: condition: service_started frontend: build: context: ./frontend dockerfile: Dockerfile target: ${FRONTEND_DOCKER_TARGET:-prod} ports: - "4200:4200" volumes: - ./frontend:/app environment: APP_TITLE: Local App PORT: 4200 depends_on: controller: condition: service_started jobs: condition: service_started