From a196ba2c08bd16479134ab542f2560b75f19424f Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 15 Jul 2020 15:45:02 +0200 Subject: Make frontend independent of API This change makes the frontend independent of the API by removing the static file serving logic from the API server. Instead, we can serve the frontend as static HTML over CDNs. --- docker-compose.yml | 61 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 26 deletions(-) (limited to 'docker-compose.yml') diff --git a/docker-compose.yml b/docker-compose.yml index 6dc01f67..837f9019 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,21 @@ version: "3" services: + frontend: + build: + context: ./frontend + args: + - REACT_APP_OAUTH_CLIENT_ID=${OPENDC_OAUTH_CLIENT_ID} + image: frontend + restart: on-failure + ports: + - "8081:80" + networks: + - backend + api: build: ./api image: api restart: on-failure - ports: - - "8081:8081" networks: - backend depends_on: @@ -20,34 +30,33 @@ services: - OPENDC_DB_HOST=mongo - OPENDC_FLASK_SECRET - OPENDC_OAUTH_CLIENT_ID - - REACT_APP_OAUTH_CLIENT_ID=${OPENDC_OAUTH_CLIENT_ID} - OPENDC_ROOT_DIR - OPENDC_SERVER_BASE_URL -# TODO: Implement new database interaction on the simulator side -# simulator: -# build: -# context: ./opendc-simulator -# dockerfile: opendc-model-odc/setup/Dockerfile -# image: simulator -# restart: on-failure -# links: -# - mongo -# depends_on: -# - mongo -# environment: -# - PERSISTENCE_URL=jdbc:mysql://mariadb:3306/opendc -# - PERSISTENCE_USER=opendc -# - PERSISTENCE_PASSWORD=opendcpassword -# - COLLECT_MACHINE_STATES=ON -# - COLLECT_TASK_STATES=ON -# - COLLECT_STAGE_MEASUREMENTS=OFF -# - COLLECT_TASK_METRICS=OFF -# - COLLECT_JOB_METRICS=OFF + # TODO: Implement new database interaction on the simulator side + # simulator: + # build: + # context: ./opendc-simulator + # dockerfile: opendc-model-odc/setup/Dockerfile + # image: simulator + # restart: on-failure + # links: + # - mongo + # depends_on: + # - mongo + # environment: + # - PERSISTENCE_URL=jdbc:mysql://mariadb:3306/opendc + # - PERSISTENCE_USER=opendc + # - PERSISTENCE_PASSWORD=opendcpassword + # - COLLECT_MACHINE_STATES=ON + # - COLLECT_TASK_STATES=ON + # - COLLECT_STAGE_MEASUREMENTS=OFF + # - COLLECT_TASK_METRICS=OFF + # - COLLECT_JOB_METRICS=OFF mongo: build: - context: database + context: database restart: on-failure environment: - MONGO_INITDB_ROOT_USERNAME @@ -79,8 +88,8 @@ services: ME_CONFIG_MONGODB_ADMINPASSWORD: "${MONGO_INITDB_ROOT_PASSWORD}" volumes: - mongo-volume: - external: false + mongo-volume: + external: false networks: backend: {} -- cgit v1.2.3