New production setup with Docker Compose

Updated openslides-manage-service and changed README.md

Added GitHub workflow.
This commit is contained in:
Norman Jäckel 2021-04-24 10:20:12 +02:00
parent 2fd4160aaa
commit e9357b2c10
3 changed files with 120 additions and 30 deletions

79
.github/workflows/build_images.yml vendored Normal file
View File

@ -0,0 +1,79 @@
---
name: Build Docker images for all OpenSlides services
on: push
env:
IMAGE_VERSION: 4.0.0-dev
jobs:
build:
name: Builds Docker images
runs-on: ubuntu-latest
strategy:
matrix:
service:
- name: openslides-proxy
directory: proxy
- name: openslides-client
directory: openslides-client
- name: openslides-backend
directory: openslides-backend
- name: openslides-datastore-reader
directory: openslides-datastore-service
args:
MODULE: reader
PORT: 9010
- name: openslides-datastore-writer
directory: openslides-datastore-service
args:
MODULE: writer
PORT: 9011
- name: openslides-autoupdate
directory: openslides-autoupdate-service
- name: openslides-auth
directory: openslides-auth-service
- name: openslides-media
directory: openslides-media-service
- name: openslides-manage
directory: openslides-manage-service
- name: openslides-permission
directory: openslides-permission-service
steps:
- name: Check out code
uses: actions/checkout@v2
with:
submodules: true
- name: Build image
working-directory: ${{ matrix.service.directory }}
env:
DOCKER_BUILDKIT=1
run: |
if [ ${{ matrix.service.args }} != "" ]
then
export BUILD_ARGS="--build-arg MODULE=${{ matrix.service.args.MODULE }}
--build-arg PORT=${{ matrix.service.args.PORT }}"
fi
docker build . --tag ${{ matrix.service.name }} $BUILD_ARGS
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" |
docker login docker.pkg.github.com --username ${{ github.actor }} --password-stdin
- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/${{ matrix.service.name }}
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag ${{ matrix.service.name }} $IMAGE_ID:$IMAGE_VERSION
docker push $IMAGE_ID:$IMAGE_VERSION

View File

@ -8,50 +8,61 @@ https://openslides.com for more information.
__Note: OpenSlides 4 is currently under development.__ __Note: OpenSlides 4 is currently under development.__
### Architecture of OpenSlides 4
## Architecture of OpenSlides 4
![System architecture of OpenSlides 4](docs/OpenSlides4-systemarchitecture.png) ![System architecture of OpenSlides 4](docs/OpenSlides4-systemarchitecture.png)
Read more about our [concept of OpenSlides 4.0](https://github.com/OpenSlides/OpenSlides/wiki/DE%3A-Konzept-OpenSlides-4). Read more about our [concept of OpenSlides 4.0](https://github.com/OpenSlides/OpenSlides/wiki/DE%3A-Konzept-OpenSlides-4).
## Installation ## Installation
NOTE: Do not use prod at the moment. It will not work. Please refer to the DEVELOPMENT.md! ### Requirements
Required software: Docker, docker-compose, make, git You need [Docker](https://docs.docker.com/engine/install/) and [Docker
Compose](https://docs.docker.com/compose/install/).
For a non-development setup, clone this repo and run it via docker compose. The make command is a handy shortcut for this: ### Setup OpenSlides
$ git clone git@github.com:OpenSlides/OpenSlides.git Go to a nice place in your filesystem and get the [OpenSlides manage
$ cd OpenSlides tool](https://github.com/OpenSlides/openslides-manage-service/releases/tag/latest).
$ git checkout openslides4-dev # needed, until OS4 is released
$ make run-prod Create configuration files:
$ ./manage setup --cwd # TODO: Provide instruction using XDG_DATA_PATH.
Build and start Docker containers. According to your Docker installation you may
have to run this as root:
$ docker-compose up --build --detach
Setup initial-data:
$ ./manage initial-data
Now you can open http://localhost:8000 and use OpenSlides.
To stop OpenSlides run:
$ docker-compose stop
To remove all containers including the complete database run:
$ docker-compose rm
## Installation with ...
TODO: Provide a short instruction for setup with Docker Swarm or Kubernetes or
something else.
## Development setup
For a development setup, refer to [the development docs](DEVELOPMENT.md) For a development setup, refer to [the development docs](DEVELOPMENT.md)
## Productive environment
Setup the repository (may be already done)
$ git clone git@github.com:OpenSlides/OpenSlides.git
$ cd OpenSlides
$ git checkout openslides4-dev
$ git submodule update --init
Prod setup. `./build.sh` may take a while.
$ cd docker
$ m4 docker-compose.yml.m4 > docker-compose.yml
$ ./build.sh
$ ./setup-prod.sh
$ docker-compose up
Navigate to https://localhost:8000
## Used software ## Used software
OpenSlides uses the following projects or parts of them: OpenSlides uses the following projects or parts of them:

@ -1 +1 @@
Subproject commit 6ab94da8debbd0367a34f173ccc1ddee5a701863 Subproject commit 2982c8880184cfab59a9792e79c62435ffc46f8d