Merge pull request #5436 from FinnStutzenstein/clientStartup

Fixed client startup
This commit is contained in:
Finn Stutzenstein 2020-07-06 09:14:39 +02:00 committed by GitHub
commit 57b4dbd463
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 73 additions and 52 deletions

2
.gitignore vendored
View File

@ -24,4 +24,6 @@ tests
.venv/ .venv/
.vscode/ .vscode/
package-lock.json package-lock.json
server/
docker/

View File

@ -13,6 +13,9 @@ build-dev:
run-dev: | build-dev run-dev: | build-dev
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
stop-dev:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml down
copy-node-modules: copy-node-modules:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml exec client bash -c "cp -r /app/node_modules/ /app/src/" docker-compose -f docker-compose.yml -f docker-compose.dev.yml exec client bash -c "cp -r /app/node_modules/ /app/src/"
mv openslides-client/client/src/node_modules/ openslides-client/client/ mv openslides-client/client/src/node_modules/ openslides-client/client/

2
dc-dev.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
docker-compose -f docker-compose.yml -f docker-compose.dev.yml $@

View File

@ -10,7 +10,11 @@ services:
volumes: volumes:
- ./openslides-datastore-service/shared/shared:/app/shared - ./openslides-datastore-service/shared/shared:/app/shared
- ./openslides-datastore-service/writer/writer:/app/writer - ./openslides-datastore-service/writer/writer:/app/writer
- ./cli:/app/cli - ./openslides-datastore-service/cli:/app/cli
environment:
- DATASTORE_ENABLE_DEV_ENVIRONMENT=1
- COMMAND=create_initial_data
- DATASTORE_INITIAL_DATA_FILE=https://raw.githubusercontent.com/OpenSlides/OpenSlides/openslides4-dev/docs/example-data.json
client: client:
image: openslides-client-dev image: openslides-client-dev
volumes: volumes:
@ -22,8 +26,8 @@ services:
autoupdate: autoupdate:
image: openslides-autoupdate-dev image: openslides-autoupdate-dev
volumes: volumes:
- ./openslides-autoupdate-service/cmd:/app/cmd - ./openslides-autoupdate-service/cmd:/root/cmd
- ./openslides-autoupdate-service/internal:/app/internal - ./openslides-autoupdate-service/internal:/root/internal
haproxy: haproxy:
image: openslides-haproxy-dev image: openslides-haproxy-dev
volumes: volumes:

View File

@ -1,13 +1,5 @@
version: '3' version: '3'
services: services:
datastore-writer:
build:
context: "https://github.com/OpenSlides/openslides-datastore-service.git"
args:
GIT_CHECKOUT: "${OPENSLIDES_DATASTORE_SERVICE_COMMIT_HASH}"
MODULE: "writer"
PORT: "${OPENSLIDES_DATASTORE_WRITER_PORT}"
image: openslides-datastore-writer
datastore-reader: datastore-reader:
build: build:
context: "https://github.com/OpenSlides/openslides-datastore-service.git" context: "https://github.com/OpenSlides/openslides-datastore-service.git"
@ -16,12 +8,67 @@ services:
MODULE: "reader" MODULE: "reader"
PORT: "${OPENSLIDES_DATASTORE_READER_PORT}" PORT: "${OPENSLIDES_DATASTORE_READER_PORT}"
image: openslides-datastore-reader image: openslides-datastore-reader
networks:
- backend
- datastore-postgresql
datastore-writer:
build:
context: "https://github.com/OpenSlides/openslides-datastore-service.git"
args:
GIT_CHECKOUT: "${OPENSLIDES_DATASTORE_SERVICE_COMMIT_HASH}"
MODULE: "writer"
PORT: "${OPENSLIDES_DATASTORE_WRITER_PORT}"
image: openslides-datastore-writer
networks:
- backend
- datastore-postgresql
- message-bus
datastore-postgresql:
networks:
- datastore-postgresql
client: client:
build: build:
context: "https://github.com/OpenSlides/openslides-client.git" context: "https://github.com/OpenSlides/openslides-client.git"
args: args:
GIT_CHECKOUT: "${OPENSLIDES_CLIENT_COMMIT_HASH}" GIT_CHECKOUT: "${OPENSLIDES_CLIENT_COMMIT_HASH}"
image: openslides-client image: openslides-client
networks:
- frontend
backend:
networks:
- frontend
- backend
autoupdate:
networks:
- frontend
- backend
- message-bus
message-bus:
networks:
- message-bus
haproxy: haproxy:
build: ./haproxy build: ./haproxy
image: openslides-haproxy image: openslides-haproxy
networks:
- uplink
- frontend
# Setup: host <-uplink-> haproxy <-frontend-> services that are reachable from the client <-backend-> services that are internal-only
# There are special networks for some services only, e.g. datastore-postgresql only for the postgresql, datastore reader and datastore writer
networks:
uplink:
frontend:
internal: true
backend:
internal: true
datastore-postgresql:
internal: true
message-bus:
internal: true

View File

@ -5,18 +5,11 @@ services:
depends_on: depends_on:
- datastore-postgresql - datastore-postgresql
env_file: services.env env_file: services.env
networks:
- backend
- datastore-postgresql
datastore-writer: datastore-writer:
depends_on: depends_on:
- datastore-postgresql - datastore-postgresql
- message-bus - message-bus
env_file: services.env env_file: services.env
networks:
- backend
- datastore-postgresql
- message-bus
datastore-postgresql: datastore-postgresql:
image: sameersbn/postgresql:10 image: sameersbn/postgresql:10
labels: labels:
@ -25,16 +18,12 @@ services:
- DB_USER=openslides - DB_USER=openslides
- DB_PASS=openslides - DB_PASS=openslides
- DB_NAME=openslides - DB_NAME=openslides
networks:
- datastore-postgresql
# CLIENT # CLIENT
client: client:
depends_on: depends_on:
- backend - backend
- autoupdate - autoupdate
networks:
- frontend
# BACKEND # BACKEND
backend: backend:
@ -42,9 +31,6 @@ services:
- datastore-reader - datastore-reader
- datastore-writer - datastore-writer
env_file: services.env env_file: services.env
networks:
- frontend
- backend
# AUTOUPDATE # AUTOUPDATE
autoupdate: autoupdate:
@ -52,16 +38,10 @@ services:
- datastore-reader - datastore-reader
- message-bus - message-bus
env_file: services.env env_file: services.env
networks:
- frontend
- backend
- message-bus
# SHARED # SHARED
message-bus: message-bus:
image: redis:alpine image: redis:alpine
networks:
- message-bus
# UPLINK # UPLINK
haproxy: haproxy:
@ -71,19 +51,3 @@ services:
- autoupdate - autoupdate
ports: ports:
- "8000:8000" - "8000:8000"
networks:
- uplink
- frontend
# Setup: host <-uplink-> haproxy <-frontend-> services that are reachable from the client <-backend-> services that are internal-only
# There are special networks for some services only, e.g. datastore-postgresql only for the postgresql, datastore reader and datastore writer
networks:
uplink:
frontend:
internal: true
backend:
internal: true
datastore-postgresql:
internal: true
message-bus:
internal: true

@ -1 +1 @@
Subproject commit 453ffe428722da38cc6f06360726089b884d5c35 Subproject commit b7ed9c98b13dd5f33f8d35a8a0ae9abf60f7ba0a

@ -1 +1 @@
Subproject commit a0d8a222429e7efd048730b823a3247d2f44a4ff Subproject commit b4de8cf3362961fc4a3511ca63fea50308b35bab

View File

@ -1,14 +1,13 @@
MESSAGE_BUS_HOST=message-bus MESSAGE_BUS_HOST=message-bus
MESSAGE_BUS_PORT=6379 MESSAGE_BUS_PORT=6379
DATASTORE_DATABASE_HOST=datastore-postgresql
# see https://github.com/OpenSlides/openslides-datastore-service/issues/56
DATASTORE_READER_HOST=datastore-reader DATASTORE_READER_HOST=datastore-reader
DATASTORE_READER_PORT=9010 DATASTORE_READER_PORT=9010
DATASTORE_WRITER_HOST=datastore-writer DATASTORE_WRITER_HOST=datastore-writer
DATASTORE_WRITER_PORT=9011 DATASTORE_WRITER_PORT=9011
DATASTORE_DATABASE_HOST=datastore-postgresql
ACTION_HOST=backend ACTION_HOST=backend
ACTION_PORT=9002 ACTION_PORT=9002
PRESENTER_HOST=backend PRESENTER_HOST=backend