Compare commits

..

10 Commits

Author SHA1 Message Date
Sergey Bolshakov aa76657ea9 подключение к бд через prisma 2026-03-10 23:21:45 +03:00
Иван f62c27f27c remove gitlab ci
CI / build-and-start (push) Successful in 46s Details
CI / deploy (push) Successful in 47s Details
2026-03-10 22:33:29 +03:00
Иван 28edaef77d fix deploy 3
CI / build-and-start (push) Successful in 46s Details
CI / deploy (push) Successful in 1m19s Details
2026-03-10 22:20:16 +03:00
Иван f887be2884 fix deploy 2
CI / build-and-start (push) Successful in 44s Details
CI / deploy (push) Failing after 1s Details
2026-03-10 22:18:15 +03:00
Иван b321c3a206 fix docker deploy
CI / build-and-start (push) Successful in 45s Details
CI / deploy (push) Failing after 5s Details
2026-03-10 22:15:28 +03:00
Иван aba3763294 add docker deploy
CI / build-and-start (push) Successful in 44s Details
CI / deploy (push) Failing after 13s Details
2026-03-10 22:11:32 +03:00
Иван e45fd58232 fix pipline 2
CI / build-and-start (push) Successful in 48s Details
2026-03-10 21:54:50 +03:00
Иван a4e3861725 fix pipline
CI / build-and-start (push) Has been cancelled Details
2026-03-10 21:50:22 +03:00
Иван bc358547b5 trigger pipeline
CI / build-and-start (push) Failing after 51s Details
2026-03-10 21:48:03 +03:00
Иван d68c0b5756 fix ci/cd 2 2026-03-10 21:44:04 +03:00
3 changed files with 29 additions and 67 deletions

View File

@ -6,19 +6,13 @@ on:
jobs:
build-and-start:
# Must match your runner's labels (e.g. from act_runner register --labels).
# If your runner has other labels, replace with those (e.g. runs-on: my-runner).
runs-on: [self-hosted]
runs-on: [ubuntu-latest, docker]
container:
image: node:20-bookworm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
@ -30,3 +24,19 @@ jobs:
timeout 20 npm run start:prod || [ $? -eq 124 ]
env:
PORT: 4000
deploy:
needs: build-and-start
runs-on: [ubuntu-latest, docker]
container:
image: node:20-bookworm
steps:
- name: Install Docker
run: apt-get update -qq && apt-get install -y -qq docker.io docker-compose
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
run: docker-compose -p docker-stack up -d --build backend
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
UPLOADS_PATH: ${{ secrets.UPLOADS_PATH }}

View File

@ -1,16 +0,0 @@
stages:
- deploy
variables:
COMPOSE_PROJECT_NAME: travelmarine-backend
DOCKER_HOST: unix:///var/run/docker.sock
deploy:
stage: deploy
only:
- main
script:
- docker compose -p "$COMPOSE_PROJECT_NAME" up -d --build
environment:
name: production
url: http://89.169.188.2

View File

@ -1,50 +1,18 @@
services:
postgres:
image: postgres:16-alpine
restart: always
environment:
POSTGRES_DB: travelmarinedb
POSTGRES_USER: yacht
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change_me}
volumes:
- pg-data:/var/lib/postgresql/data
ports:
- '127.0.0.1:5432:5432'
backend:
build: .
restart: always
environment:
NODE_ENV: production
PORT: 4000
DATABASE_URL: postgresql://yacht:${POSTGRES_PASSWORD:-change_me}@postgres:5432/travelmarinedb
UPLOAD_PATH: ./uploads
APP_URL: http://localhost:4000
DATABASE_URL: ${DATABASE_URL}
UPLOAD_PATH: /app/uploads
APP_URL: ${APP_URL:-https://api.travelmarine.ru}
volumes:
- ./uploads:/app/uploads
depends_on:
- postgres
ports:
- '127.0.0.1:4000:4000'
restart: always
- ${UPLOADS_PATH:-./uploads}:/app/uploads
networks:
- app-network
pgbackup:
image: prodrigestivill/postgres-backup-local:16
restart: always
depends_on:
- postgres
environment:
POSTGRES_HOST: postgres
POSTGRES_DB: yachtbooking
POSTGRES_USER: yacht
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change_me}
SCHEDULE: '0 3 * * *'
BACKUP_KEEP_DAYS: 7
BACKUP_KEEP_WEEKS: 4
BACKUP_KEEP_MONTHS: 3
BACKUP_DIR: /backups
volumes:
- pg-backups:/backups
volumes:
pg-data:
pg-backups:
networks:
app-network:
external: true