Files
myDrive/docker-compose-test.yml
T
oxmc 22af2caec7
Release Please / release-please (push) Has been cancelled
Docker Build and Push (Development) / build-and-push-dev (push) Has been cancelled
feat: default to SQLite engine, disable Mongo service by default in compose
Mongo services in both compose files are now commented out (with instructions
to re-enable) since DB_ENGINE now defaults to sqlite - no separate database
container required out of the box. db-data volume is mounted into the app
service (not just mongo) so it can hold the SQLite file too.

Also fixes a require-order bug in tests/utils/express-app.js: routers were
required (eagerly instantiating DB singletons via dbFactory) before the test
env file was loaded, so DB_ENGINE from .env.test was silently never applied -
it only worked before because the old hardcoded default happened to be mongo.
2026-07-05 04:48:54 -07:00

66 lines
2.5 KiB
YAML

services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: mydrive
volumes:
# Use the following volumes section if you want to use bind mounts:
# - /path/to/data:/data/
# - /path/to/temp:/temp/
# Use the following volumes section if you want to use named volumes:
- mydrive-data:/data/
- mydrive-temp:/temp/
# Only needed when DB_ENGINE=sqlite - stores the embedded SQLite
# metadata file, separate from mydrive-data (which holds file bytes).
- db-data:/db-data/
ports:
- "${HTTP_PORT:-3000}:3000"
# Optional: Uncomment the following line if you want to use HTTPS
# - "${HTTPS_PORT:-8080}:8080"
# Use expose: if using a reverse proxy
# expose:
# - 3000
# - 8080
env_file:
- .env.test # Copy .env.example to .env.test or .env and fill in the values
# Mongo service - only needed when DB_ENGINE=mongo in your env file.
# Commented out for DB_ENGINE=sqlite testing (metadata is stored in an
# embedded SQLite file under the db-data volume via SQLITE_DB_PATH,
# so no separate database service is required). Note: db-data is also
# mounted into the app service above - it's not Mongo-exclusive, it just
# also happens to be where Mongo keeps its data.
#
# To bring MongoDB back: uncomment this service block below, set
# DB_ENGINE=mongo and MONGODB_URL in your env file, then
# `docker compose -f docker-compose-test.yml up --build`.
# (The db-data volume stays declared below regardless, so any existing
# Mongo data already stored in it is preserved either way.)
#
# mongo:
# image: mongo:8
# container_name: mongo
# restart: always
# environment:
# MONGO_INITDB_ROOT_USERNAME: username
# MONGO_INITDB_ROOT_PASSWORD: password
# expose:
# - 27017
# volumes:
# - db-data:/data/db
# healthcheck:
# test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
# timeout: 10s
# interval: 10s
# retries: 10
# start_period: 10s
# Use the following volumes section if you want to use named volumes. Useful for development.
volumes:
mydrive-data:
mydrive-temp:
db-data: # only used if the `mongo` service above is uncommented; kept declared so existing Mongo data isn't orphaned