diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 7366d98..efb051d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -51,11 +51,11 @@ jobs: IMAGE_NAME=artourkin/fitsinn-rest CONTEXT=. if [ "${{ github.ref }}" == "refs/heads/main" ]; then - docker buildx build --push --tag $IMAGE_NAME:latest $CONTEXT + docker buildx build --platform linux/amd64,linux/arm64 --push --tag $IMAGE_NAME:latest $CONTEXT elif [[ "${{ github.ref }}" == refs/tags/* ]]; then - docker buildx build --push --tag $IMAGE_NAME:$GIT_TAG $CONTEXT + docker buildx build --platform linux/amd64,linux/arm64 --push --tag $IMAGE_NAME:$GIT_TAG $CONTEXT else - docker buildx build --push --tag $IMAGE_NAME:$BRANCH_NAME-$GIT_SHA_SHORT $CONTEXT + docker buildx build --platform linux/amd64,linux/arm64 --push --tag $IMAGE_NAME:$BRANCH_NAME-$GIT_SHA_SHORT $CONTEXT fi - name: Cache node modules @@ -81,11 +81,11 @@ jobs: IMAGE_NAME=artourkin/fitsinn-web CONTEXT=./web if [ "${{ github.ref }}" == "refs/heads/main" ]; then - docker buildx build --push --tag $IMAGE_NAME:latest $CONTEXT + docker buildx build --platform linux/amd64,linux/arm64 --push --tag $IMAGE_NAME:latest $CONTEXT elif [[ "${{ github.ref }}" == refs/tags/* ]]; then - docker buildx build --push --tag $IMAGE_NAME:$GIT_TAG $CONTEXT + docker buildx build --platform linux/amd64,linux/arm64 --push --tag $IMAGE_NAME:$GIT_TAG $CONTEXT else - docker buildx build --push --tag $IMAGE_NAME:$BRANCH_NAME-$GIT_SHA_SHORT $CONTEXT + docker buildx build --platform linux/amd64,linux/arm64 --push --tag $IMAGE_NAME:$BRANCH_NAME-$GIT_SHA_SHORT $CONTEXT fi - name: Build and push FITS WEB @@ -93,11 +93,11 @@ jobs: IMAGE_NAME=artourkin/fits-web CONTEXT=./fits if [ "${{ github.ref }}" == "refs/heads/main" ]; then - docker buildx build --push --tag $IMAGE_NAME:latest $CONTEXT + docker buildx build --platform linux/amd64,linux/arm64 --push --tag $IMAGE_NAME:latest $CONTEXT elif [[ "${{ github.ref }}" == refs/tags/* ]]; then - docker buildx build --push --tag $IMAGE_NAME:$GIT_TAG $CONTEXT + docker buildx build --platform linux/amd64,linux/arm64 --push --tag $IMAGE_NAME:$GIT_TAG $CONTEXT else - docker buildx build --push --tag $IMAGE_NAME:$BRANCH_NAME-$GIT_SHA_SHORT $CONTEXT + docker buildx build --platform linux/amd64,linux/arm64 --push --tag $IMAGE_NAME:$BRANCH_NAME-$GIT_SHA_SHORT $CONTEXT fi diff --git a/docker-compose.yaml b/docker-compose.yaml index c464759..f824393 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,7 @@ version: '3' services: fits: - image: artourkin/fits-web:main + image: artourkin/fits-web:latest container_name: fits env_file: .env networks: @@ -13,20 +13,24 @@ services: - 8081:8080 rest: - image: artourkin/fitsinn-rest:main container_name: rest + image: artourkin/fitsinn-rest:latest env_file: .env networks: - web restart: unless-stopped + environment: + - DB_SELECTOR=clickhouse + deploy: + replicas: 1 ports: - - 8082:8080 + - 8092:8080 depends_on: - fits - db-docker web: - image: artourkin/fitsinn-web:main + image: artourkin/fitsinn-web:latest container_name: web env_file: .env networks: @@ -36,17 +40,61 @@ services: - 8080:3000 db-docker: - image: oscarfonts/h2 + image: yandex/clickhouse-server container_name: db-docker - env_file: .env - environment: - - H2_OPTIONS=-ifNotExists networks: - web + ports: + - 8123:8123 + - 9000:9000 + - 9004:9004 + + + db-docker-init: + image: yandex/clickhouse-server + container_name: db-docker-init + volumes: + - ./config/clickhouse:/var/clickhouse + depends_on: + - db-docker + networks: + - web + entrypoint: [ '/bin/sh', '-c' ] + command: | + " + while ! clickhouse-client --host db-docker -q \"SHOW databases;\"; do + echo waiting for clickhouse up + sleep 1 + done + + clickhouse-client --host db-docker --queries-file /var/clickhouse/initdb.sql + + tail -f /dev/null + " + + + adminer: + image: adminer + container_name: adminer + env_file: .env restart: unless-stopped + networks: + - web ports: - - 1521:1521 - - 81:81 + - 8090:8080 + + nginx: + image: nginx + container_name: nginx + env_file: .env + volumes: + - ./config/nginx/nginx.conf:/etc/nginx/conf.d/default.conf + ports: + - 8082:80 + networks: + - web + depends_on: + - rest networks: web: \ No newline at end of file