Skip to content

Commit

Permalink
Update docker-compose.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
aeifn committed Nov 11, 2023
1 parent 466ab14 commit e95f420
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 46 deletions.
5 changes: 5 additions & 0 deletions .docker/mailpit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
mailpit:
image: axllent/mailpit:latest
ports:
- "127.0.0.1:1080:8025"
11 changes: 11 additions & 0 deletions .docker/mongo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
mongo:
image: mongo:4.4
volumes:
- mongo4:/data/db
- ./dev-initdb.sh:/usr/local/bin/initdb
ports:
- "127.0.0.1:27017:27017"

volumes:
mongo4:
3 changes: 3 additions & 0 deletions .docker/redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
services:
redis:
image: redis:6.2.6
11 changes: 8 additions & 3 deletions config/local.config.js.docker-example
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright: The PastVu contributors.
* GNU Affero General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/agpl.txt)
*/

module.exports = function (config, appRequire) {
const _ = appRequire('lodash');

Expand All @@ -22,17 +27,17 @@ module.exports = function (config, appRequire) {
storePath: '/store',

mongo: {
connection: 'mongodb://mongo:27017/pastvu',
connection: 'mongodb://mongo/pastvu',
},
mongo_api: {
con: 'mongodb://mongo:27017/pastvu',
con: 'mongodb://mongo/pastvu',
},
redis: {
host: 'redis',
},
mail: {
type: 'SMTP',
host: 'mailcatcher',
host: 'mailpit',
port: 1025,
},
});
Expand Down
50 changes: 7 additions & 43 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,99 +1,63 @@
version: '3.9'

include:
- .docker/mongo.yaml
- .docker/redis.yaml
- .docker/mailpit.yaml

x-defaults: &app-image
build: ./.docker
image: pastvu_node
environment:
- NODE_ENV=development
extra_hosts:
- "host.docker.internal:host-gateway"

services:
mongo:
image: mongo:4.4
volumes:
- mongo4:/data/db
- ./.docker/dev-initdb.sh:/usr/local/bin/initdb
expose:
- "27017"
ports:
- "127.0.0.1:27017:27017"

redis:
image: redis:6.2.6
expose:
- "6379"

app:
<< : *app-image
expose:
- "3000"
- "3010"
- "3011"
ports:
- "3000:3000"
depends_on:
- "mongo"
- "redis"
volumes:
- .:/code
- store:/store
command: run app --primary

worker:
<< : *app-image
depends_on:
- "app"
volumes:
- .:/code
- store:/store
command: run worker

notifier:
<< : *app-image
depends_on:
- "app"
volumes:
- .:/code
command: run notifier

uploader:
<< : *app-image
expose:
- "3001"
depends_on:
- "app"
volumes:
- .:/code
- store:/store
command: run uploader

downloader:
<< : *app-image
expose:
- "3002"
depends_on:
- "app"
volumes:
- .:/code
- store:/store:ro
command: run downloader

sitemap:
<< : *app-image
depends_on:
- "app"
volumes:
- .:/code
- sitemap:/sitemap
command: run sitemap

mailcatcher:
image: axllent/mailpit:latest
expose:
- "1025"
ports:
- "127.0.0.1:1080:8025"

volumes:
store:
sitemap:
mongo4:

0 comments on commit e95f420

Please sign in to comment.