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/
.vscode/
package-lock.json
server/
docker/

View File

@ -13,6 +13,9 @@ build-dev:
run-dev: | build-dev
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:
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/

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:
- ./openslides-datastore-service/shared/shared:/app/shared
- ./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:
image: openslides-client-dev
volumes:
@ -22,8 +26,8 @@ services:
autoupdate:
image: openslides-autoupdate-dev
volumes:
- ./openslides-autoupdate-service/cmd:/app/cmd
- ./openslides-autoupdate-service/internal:/app/internal
- ./openslides-autoupdate-service/cmd:/root/cmd
- ./openslides-autoupdate-service/internal:/root/internal
haproxy:
image: openslides-haproxy-dev
volumes:

View File

@ -1,13 +1,5 @@
version: '3'
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:
build:
context: "https://github.com/OpenSlides/openslides-datastore-service.git"
@ -16,12 +8,67 @@ services:
MODULE: "reader"
PORT: "${OPENSLIDES_DATASTORE_READER_PORT}"
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:
build:
context: "https://github.com/OpenSlides/openslides-client.git"
args:
GIT_CHECKOUT: "${OPENSLIDES_CLIENT_COMMIT_HASH}"
image: openslides-client
networks:
- frontend
backend:
networks:
- frontend
- backend
autoupdate:
networks:
- frontend
- backend
- message-bus
message-bus:
networks:
- message-bus
haproxy:
build: ./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:
- datastore-postgresql
env_file: services.env
networks:
- backend
- datastore-postgresql
datastore-writer:
depends_on:
- datastore-postgresql
- message-bus
env_file: services.env
networks:
- backend
- datastore-postgresql
- message-bus
datastore-postgresql:
image: sameersbn/postgresql:10
labels:
@ -25,16 +18,12 @@ services:
- DB_USER=openslides
- DB_PASS=openslides
- DB_NAME=openslides
networks:
- datastore-postgresql
# CLIENT
client:
depends_on:
- backend
- autoupdate
networks:
- frontend
# BACKEND
backend:
@ -42,9 +31,6 @@ services:
- datastore-reader
- datastore-writer
env_file: services.env
networks:
- frontend
- backend
# AUTOUPDATE
autoupdate:
@ -52,16 +38,10 @@ services:
- datastore-reader
- message-bus
env_file: services.env
networks:
- frontend
- backend
- message-bus
# SHARED
message-bus:
image: redis:alpine
networks:
- message-bus
# UPLINK
haproxy:
@ -71,19 +51,3 @@ services:
- autoupdate
ports:
- "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_PORT=6379
DATASTORE_DATABASE_HOST=datastore-postgresql
# see https://github.com/OpenSlides/openslides-datastore-service/issues/56
DATASTORE_READER_HOST=datastore-reader
DATASTORE_READER_PORT=9010
DATASTORE_WRITER_HOST=datastore-writer
DATASTORE_WRITER_PORT=9011
DATASTORE_DATABASE_HOST=datastore-postgresql
ACTION_HOST=backend
ACTION_PORT=9002
PRESENTER_HOST=backend