Skip to content

Commit

Permalink
chore: deploy redis service with docker (#1958)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascariandrea committed Jan 1, 2025
1 parent b47f70f commit 13c44d2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
15 changes: 12 additions & 3 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ services:
# timeout: 20s
# retries: 3

redis.liexp.dev:
restart: always
image: 'redis:7.2'
ports:
- '127.0.0.1:6379:6379'
volumes:
- redis-data:/data
networks:
- reverseproxy

api-base:
build:
context: .
Expand All @@ -66,6 +76,7 @@ services:
depends_on:
- db.liexp.dev
- fra1.space.liexp.dev
- redis.liexp.dev
volumes:
- api-node-modules:/usr/src/app/node_modules
- ./packages/@liexp:/usr/src/app/packages/@liexp:ro
Expand Down Expand Up @@ -96,9 +107,6 @@ services:
environment:
TG_BOT_POLLING: "true"
mem_limit: 512M
depends_on:
- db.liexp.dev
- fra1.space.liexp.dev
networks:
- reverseproxy

Expand Down Expand Up @@ -188,6 +196,7 @@ volumes:
web-node-modules: {}
admin-node-modules: {}
space-data: {}
redis-data: {}

networks:
reverseproxy:
Expand Down
11 changes: 11 additions & 0 deletions deploy/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ services:
start_period: 30s
command: pnpm start
mem_limit: 1G
depends_on:
- redis

worker:
extends: api-base
Expand All @@ -40,6 +42,7 @@ services:
mem_limit: 512M
depends_on:
- telegram-bot-api
- redis
network_mode: "host"

ai-bot:
Expand Down Expand Up @@ -76,6 +79,14 @@ services:
max-file: 5
max-size: 10m

redis:
restart: always
image: redis:7.2
ports:
- "127.0.0.1:6379:6379"
volumes:
- ./redis-data:/data

telegram-bot-api:
image: aiogram/telegram-bot-api:latest
env_file:
Expand Down
5 changes: 3 additions & 2 deletions scripts/docker-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ssh $SSH_DOMAIN "bash -s $username" << "EOF"
mkdir -p ./temp/tg/messages
mkdir -p ./temp/media
mkdir -p ./temp/queue
mkdir -p ./redis-data
mkdir -p ./ai-bot-temp
chown -R pptruser:pptruser ./config
Expand All @@ -57,8 +58,8 @@ ssh $SSH_DOMAIN "bash -s $username" << "EOF"
export API_UID=$(id pptruser -u)
export API_GID=$(id pptruser -g)
docker compose --env-file .env.api pull api web
docker compose --env-file .env.api up --build --force-recreate -d --wait api worker
docker compose --env-file .env.api pull api web redis
docker compose --env-file .env.api up --build --force-recreate -d --wait api worker redis
docker compose --env-file .env.web up --build --force-recreate -d --wait --no-deps web
docker system prune -f
docker builder prune -f --all
Expand Down

0 comments on commit 13c44d2

Please sign in to comment.