summaryrefslogtreecommitdiff
path: root/docker-compose.yml
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-07-15 15:45:02 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:48:05 +0200
commita196ba2c08bd16479134ab542f2560b75f19424f (patch)
treec44ad8d0c89c8997068e7c792265bd1db43c347c /docker-compose.yml
parent02997b2522b9c66072b16f1425c02e81e0085e3c (diff)
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.
Diffstat (limited to 'docker-compose.yml')
-rw-r--r--docker-compose.yml61
1 files changed, 35 insertions, 26 deletions
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: {}