This commit is contained in:
36
.github/workflows/docker-publish.yml
vendored
Normal file
36
.github/workflows/docker-publish.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: Build and Publish Images
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, master ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Gitea Registry
|
||||||
|
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 192.168.31.100:3847 -u ${{ secrets.REGISTRY_USER }} --password-stdin
|
||||||
|
|
||||||
|
- name: Build and push backend image
|
||||||
|
run: |
|
||||||
|
docker build -t 192.168.31.100:3847/arrelin/wedding-backend:latest -t 192.168.31.100:3847/arrelin/wedding-backend:${{ gitea.sha }} ./backend
|
||||||
|
docker push 192.168.31.100:3847/arrelin/wedding-backend:latest
|
||||||
|
docker push 192.168.31.100:3847/arrelin/wedding-backend:${{ gitea.sha }}
|
||||||
|
|
||||||
|
- name: Build and push frontend image
|
||||||
|
run: |
|
||||||
|
docker build -t 192.168.31.100:3847/arrelin/wedding-frontend:latest -t 192.168.31.100:3847/arrelin/wedding-frontend:${{ gitea.sha }} ./frontend
|
||||||
|
docker push 192.168.31.100:3847/arrelin/wedding-frontend:latest
|
||||||
|
docker push 192.168.31.100:3847/arrelin/wedding-frontend:${{ gitea.sha }}
|
||||||
|
|
||||||
|
- name: Logout
|
||||||
|
run: docker logout 192.168.31.100:3847
|
||||||
|
|
||||||
|
# - name: Trigger Coolify redeploy
|
||||||
|
# run: |
|
||||||
|
# curl -s -H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \
|
||||||
|
# "http://192.168.31.100:8000/api/v1/deploy?uuid=ВСТАВЬ_UUID_СЮДА&force=true"
|
||||||
49
docker-compose.prod.yml
Normal file
49
docker-compose.prod.yml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: postgres:17-alpine
|
||||||
|
container_name: wedding_db
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: ${POSTGRES_DB:-wedding}
|
||||||
|
POSTGRES_USER: ${POSTGRES_USER:-wedding}
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
volumes:
|
||||||
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- app_network
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-wedding}"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
backend:
|
||||||
|
image: 192.168.31.100:3847/arrelin/wedding-backend:latest
|
||||||
|
container_name: wedding_backend
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: postgres://${POSTGRES_USER:-wedding}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-wedding}
|
||||||
|
PORT: 8080
|
||||||
|
RUST_LOG: ${RUST_LOG:-info}
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- app_network
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
image: 192.168.31.100:3847/arrelin/wedding-frontend:latest
|
||||||
|
container_name: wedding_frontend
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
networks:
|
||||||
|
- app_network
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
networks:
|
||||||
|
app_network:
|
||||||
|
driver: bridge
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres_data:
|
||||||
|
driver: local
|
||||||
Reference in New Issue
Block a user