Skip to content

Commit

Permalink
Fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
artur rocks committed Oct 21, 2024
1 parent b17702b commit 6de9830
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 19 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -81,23 +81,23 @@ 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
run: |
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

68 changes: 58 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:

0 comments on commit 6de9830

Please sign in to comment.