@arc-fusion/cli
Version:
CLI for running Arc Fusion on your local machine
51 lines (44 loc) • 1.21 kB
JavaScript
const os = require('os')
const path = require('path')
const isWindows = /^win/i.test(os.platform())
const { getEnvVariables } = require('../../bin/utils/local')
const { MONGO_VERSION } = require('../../bin/environment')
module.exports = async ({ REPO_NAME, PROJECT_ROOT }) => {
const env = await getEnvVariables(PROJECT_ROOT)
const volumes = (isWindows)
? {
volumes: {
[REPO_NAME]: {
external: false
}
}
}
: {}
return {
version: '3',
...volumes,
services: {
dump: {
...(env.MONGO_SOURCE_DIR && {
build: {
context: path.resolve(env.MONGO_SOURCE_DIR)
}
}),
image: `washpost/mongo-vandelay:${env.MONGO_VERSION || MONGO_VERSION}`,
command: './dump.sh',
container_name: 'fusion-dump',
environment: {
DB_NAME: `\${DB_NAME:-${REPO_NAME}}`,
MONGO_URL: `mongodb://data:27017/\${DB_NAME:-${REPO_NAME}}`,
SYNC: (isWindows) ? 'true' : ''
},
network_mode: 'none',
volumes: [
'../data/db:/data/db:rw',
'../data/dumps:/data/dumps:rw'
]
}
}
}
}