Skip to content

Commit

Permalink
Fix migration containers failing
Browse files Browse the repository at this point in the history
  • Loading branch information
synzen committed Dec 6, 2024
1 parent eff0a7c commit 5476ff5
Show file tree
Hide file tree
Showing 10 changed files with 587 additions and 6,154 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: services/user-feeds
target: prod
target: build
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: services/feed-requests
target: prod
target: build
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ services:
context: services/feed-requests
dockerfile: Dockerfile
target: build
command: "npm run migration:local:up"
command: "npm run migration:up"
depends_on:
feed-requests-postgres-db:
condition: service_started
Expand Down Expand Up @@ -194,7 +194,7 @@ services:
context: services/user-feeds
dockerfile: Dockerfile
target: build
command: npm run migration:local:up
command: npm run migration:up
depends_on:
- user-feeds-postgres-db
environment:
Expand Down
22 changes: 16 additions & 6 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ services:
command: npm run start:dev
env_file:
- ./.env.local
environment:
- NODE_ENV=development

discord-rest-listener-service:
extends:
Expand All @@ -81,7 +83,7 @@ services:
volumes:
- ./services/feed-requests:/usr/src/app
- /usr/src/app/node_modules/
command: npm run start:local
command: npm run start:watch
env_file:
- ./.env.local
environment:
Expand All @@ -90,6 +92,7 @@ services:
- FEED_REQUESTS_S3_API_KEY_ID=1
- FEED_REQUESTS_S3_API_KEY=1
- FEED_REQUESTS_START_TARGET=service
- NODE_ENV=local

feed-requests-api:
extends:
Expand All @@ -101,24 +104,26 @@ services:
ports:
- "5000:5000"
- "4999:4999"
command: npm run start:local
command: npm run start:watch
env_file:
- ./.env.local
environment:
- FEED_REQUESTS_START_TARGET=api
- NODE_ENV=local

feed-requests-postgres-migration:
extends:
file: docker-compose.base.yml
service: feed-requests-postgres-migration
command: "npm run migration:local:up"
command: "npm run migration:up"
env_file:
- ./.env.local
environment:
- FEED_REQUESTS_S3_ENDPOINT=http://seaweed-fs:8333
- FEED_REQUESTS_S3_API_KEY_ID=1
- FEED_REQUESTS_S3_API_KEY=1
- LOG_LEVEL=debug
- NODE_ENV=local

user-feeds-service:
extends:
Expand All @@ -127,12 +132,13 @@ services:
volumes:
- ./services/user-feeds:/usr/src/app
- /usr/src/app/node_modules/
command: npm run start:local
command: npm run start:watch
env_file:
- ./.env.local
environment:
- LOG_LEVEL=debug
- USER_FEEDS_START_TARGET=service
- NODE_ENV=local

user-feeds-api:
extends:
Expand All @@ -143,20 +149,23 @@ services:
- /usr/src/app/node_modules/
ports:
- "5001:5000"
command: npm run start:local
command: npm run start:watch
env_file:
- ./.env.local
environment:
- LOG_LEVEL=debug
- USER_FEEDS_START_TARGET=api
- NODE_ENV=local

user-feeds-postgres-migration:
extends:
file: docker-compose.base.yml
service: user-feeds-postgres-migration
command: npm run migration:local:up
command: npm run migration:up
env_file:
- ./.env.local
environment:
- NODE_ENV=local

# Schedule emitter
schedule-emitter-service:
Expand Down Expand Up @@ -200,6 +209,7 @@ services:
- BACKEND_API_NODE_ENV=local
- BACKEND_API_USER_FEEDS_API_HOST=http://user-feeds-api:5000
- LOG_LEVEL=debug
- NODE_ENV=local
command: npm run start:local
networks:
- monitorss-default
Expand Down
179 changes: 179 additions & 0 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
name: monitorss-prod
services:
bot-presence-service:
extends:
file: ./docker-compose.base.yml
service: bot-presence-service
build:
context: services/bot-presence
dockerfile: Dockerfile
target: prod
command: ["node", "dist/main.js"]
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

feed-requests-redis-cache:
extends:
file: ./docker-compose.base.yml
service: feed-requests-redis-cache

rabbitmq-broker:
extends:
file: ./docker-compose.base.yml
service: rabbitmq-broker

mongo:
extends:
file: ./docker-compose.base.yml
service: mongo

feed-requests-postgres-db:
extends:
file: ./docker-compose.base.yml
service: feed-requests-postgres-db

user-feeds-postgres-db:
extends:
file: ./docker-compose.base.yml
service: user-feeds-postgres-db

discord-rest-listener-service:
extends:
file: ./docker-compose.base.yml
service: discord-rest-listener-service
build:
context: services/discord-rest-listener
dockerfile: Dockerfile
target: prod
command: ["node", "build/app.js"]
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

feed-requests-service:
extends:
file: ./docker-compose.base.yml
service: feed-requests-service
build:
context: services/feed-requests
dockerfile: Dockerfile
target: build
command: ["node", "dist/main.js"]
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

feed-requests-postgres-migration:
extends:
file: ./docker-compose.base.yml
service: feed-requests-postgres-migration
build:
context: services/feed-requests
dockerfile: Dockerfile
target: build
command: "npm run migration:up"
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

user-feeds-service:
extends:
file: ./docker-compose.base.yml
service: user-feeds-service
build:
context: services/user-feeds
dockerfile: Dockerfile
target: build
command: ["node", "dist/main.js"]
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

user-feeds-postgres-migration:
extends:
file: ./docker-compose.base.yml
service: user-feeds-postgres-migration
build:
context: services/user-feeds
dockerfile: Dockerfile
target: build
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

legacy-feed-bulk-converter-service:
extends:
file: ./docker-compose.base.yml
service: legacy-feed-bulk-converter-service
build:
context: services/backend-api
dockerfile: dockerfiles/web/mixed.Dockerfile
target: prod
command: ["node", "dist/scripts/legacy-feed-bulk-converter.js"]
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

schedule-emitter-service:
extends:
file: ./docker-compose.base.yml
service: schedule-emitter-service
build:
context: services/backend-api
dockerfile: dockerfiles/web/mixed.Dockerfile
target: prod
command: ["node", "dist/scripts/schedule-emitter.js"]
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

monolith:
build:
context: services/backend-api
dockerfile: dockerfiles/web/mixed.Dockerfile
target: prod
restart: on-failure:3
depends_on:
- mongo
- user-feeds-service
- feed-requests-service
ports:
- "8000:8000"
env_file:
- ./.env.prod
environment:
- BACKEND_API_NODE_ENV=local
- BACKEND_API_PORT=8000
- BACKEND_API_DEFAULT_MAX_FEEDS=999999
- BACKEND_API_USER_FEEDS_API_HOST=http://user-feeds-service:5000
- BACKEND_API_FEED_REQUESTS_API_HOST=http://feed-requests-service:5000
- BACKEND_API_FEED_USER_AGENT=MonitoRSS
- BACKEND_API_RABBITMQ_BROKER_URL=amqp://guest:guest@rabbitmq-broker:5672/
- BACKEND_API_USER_FEEDS_API_KEY=user-feeds-api-key
- BACKEND_API_FEED_REQUESTS_API_KEY=feed-requests-api-key
- LOG_LEVEL=info
- NODE_ENV=production
command: ["node", "dist/main.js"]
networks:
- monitorss-default


volumes:
mongodb-data:
feed-requests-postgres-data:
user-feeds-postgres-data:
feed-requests-redis-data:
driver: local

networks:
monitorss-default:
driver: bridge
16 changes: 15 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ services:
command: ["node", "build/app.js"]
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

feed-requests-service:
extends:
Expand All @@ -59,9 +61,11 @@ services:
file: ./docker-compose.base.yml
service: feed-requests-postgres-migration
image: ghcr.io/synzen/monitorss-feed-requests:main
command: "npm run migration:local:up"
command: "npm run migration:prod:up"
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

user-feeds-service:
extends:
Expand All @@ -71,14 +75,19 @@ services:
command: ["node", "dist/main.js"]
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

user-feeds-postgres-migration:
extends:
file: ./docker-compose.base.yml
service: user-feeds-postgres-migration
image: ghcr.io/synzen/monitorss-user-feeds:main
command: "npm run migration:prod:up"
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

legacy-feed-bulk-converter-service:
extends:
Expand All @@ -88,6 +97,8 @@ services:
command: ["node", "dist/scripts/legacy-feed-bulk-converter.js"]
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

schedule-emitter-service:
extends:
Expand All @@ -97,6 +108,8 @@ services:
command: ["node", "dist/scripts/schedule-emitter.js"]
env_file:
- ./.env.prod
environment:
- NODE_ENV=production

monolith:
image: ghcr.io/synzen/monitorss-monolith:main
Expand All @@ -120,6 +133,7 @@ services:
- BACKEND_API_USER_FEEDS_API_KEY=user-feeds-api-key
- BACKEND_API_FEED_REQUESTS_API_KEY=feed-requests-api-key
- LOG_LEVEL=info
- NODE_ENV=production
command: ["node", "dist/main.js"]
networks:
- monitorss-default
Expand Down
Loading

0 comments on commit 5476ff5

Please sign in to comment.