From a14e64d6e2c75ef81da75a84f82f83895fb8121a Mon Sep 17 00:00:00 2001 From: TimofeyTst Date: Sun, 8 Oct 2023 14:10:36 +0300 Subject: [PATCH] test deploying --- .github/workflows/deploy-runners.yml | 35 ++++++++++++++++++++++ docker-compose.prod.yml | 44 ++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .github/workflows/deploy-runners.yml create mode 100644 docker-compose.prod.yml diff --git a/.github/workflows/deploy-runners.yml b/.github/workflows/deploy-runners.yml new file mode 100644 index 0000000..75f389f --- /dev/null +++ b/.github/workflows/deploy-runners.yml @@ -0,0 +1,35 @@ +name: Production deploy + +on: + push: + branches: [prod] + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Echo info + run: | + echo "Started deploying..." + - name: checkout repo + uses: actions/checkout@v4 + + # - name: Make envfile + # uses: SpicyPizza/create-envfile@v2.0 + # with: + # envkey_MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }} + # envkey_MONGODB_PASSWORD: ${{ secrets.MONGODB_PASSWORD }} + # envkey_RABBIT_PASSWORD: ${{ secrets.RABBIT_PASSWORD }} + # envkey_BOT_NAME: ${{ secrets.BOT_NAME }} + # envkey_BOT_TOKEN: ${{ secrets.BOT_TOKEN }} + # file_name: .env + # directory: "./" + # fail_on_empty: false + # sort_keys: false + + - name: pull images + run: docker-compose -f docker-compose.prod.yaml pull + + - name: restart containers + run: docker-compose -f docker-compose.prod.yaml up -d \ No newline at end of file diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..475dfed --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,44 @@ +version: '3.8' + +services: + + web-ui: + image: timofeytst/eat_place:web_ui_prod + ports: + - "3000:80" + restart: always + environment: + REACT_APP_DEV: prod + + db: + container_name: db + hostname: db + image: library/postgres:14.1 + + environment: + - POSTGRES_USER=rest + - POSTGRES_PASSWORD=rest + - POSTGRES_DB=rest + volumes: + - eat_place_pg_data:/var/lib/postgresql/data + ports: + - "5432:5432" + + redis: + image: redis:6.2-alpine + hostname: redis + container_name: redis + command: + - 'redis-server' + - '--requirepass myStrongPassword' + ports: + - 6379:6379 + +volumes: + eat_place_pg_data: + driver: "local" + +networks: + default: + external: true + name: eat_place