Skip to content

Instantly share code, notes, and snippets.

@yawnston
Created December 30, 2022 14:32
Show Gist options
  • Save yawnston/5dbff710cff2e73d74a1412aafc5dc71 to your computer and use it in GitHub Desktop.
Save yawnston/5dbff710cff2e73d74a1412aafc5dc71 to your computer and use it in GitHub Desktop.
My personal docker-compose file for a setup with MM-quecat and MM-evocat.
version: "2.4"
networks:
mmcat:
driver: bridge
name: mmcat
volumes:
mmcat-postgres:
mmcat-postgres-data:
mmcat-mongo-data:
services:
#######################
# MMCAT CORE SERVICES #
#######################
# Frontend of mmcat (vue deployed via nginx)
mmcat-frontend:
container_name: mmcat-frontend
build:
context: ./evolution-management/example-ui
dockerfile: Dockerfile
ports:
- "27400:80"
networks:
- mmcat
# Backend of mmcat (java spring boot)
mmcat-server:
container_name: mmcat-server
build:
context: ./evolution-management
dockerfile: Dockerfile
depends_on:
- mmcat-postgres
ports:
- "27500:27500"
networks:
- mmcat
# Postgres instance for use by mmcat (internal data structures like schema category etc.)
mmcat-postgres:
image: postgres:13.2
container_name: mmcat-postgres
environment:
PGDATA: /data/postgres
POSTGRES_DB: mmcat_server
POSTGRES_USER: mmcat_user
POSTGRES_PASSWORD: mmcat_password
ports:
# Format is <local port>:<container port>, you can change the 5444 to whatever port you want
- "5444:5432"
volumes:
- mmcat-postgres:/data/postgres
# Mounting a .sql script into the /docker-entrypoint-initdb.d/ directory will run it automatically
- ./evolution-management/server/src/main/resources/createDatabase.sql:/docker-entrypoint-initdb.d/createDatabase.sql
networks:
- mmcat
#####################
# DATABASE SERVICES #
#####################
# Postgres instance containing actual data
data-postgres:
image: postgres:13.2
container_name: mmcat-data-postgres
environment:
PGDATA: /data/postgres
POSTGRES_DB: mmcat_server_data
POSTGRES_USER: mmcat_user
POSTGRES_PASSWORD: mmcat_password
ports:
- "5445:5432"
volumes:
- mmcat-postgres-data:/data/postgres
# Mounting a .sql script into the /docker-entrypoint-initdb.d/ directory will run it automatically
- ./evolution-management/server/src/main/resources/setupPostgresql.sql:/docker-entrypoint-initdb.d/setupPostgresql.sql
networks:
- mmcat
# Postgres instance containing actual data
data-mongo:
image: mongo:6
container_name: mmcat-data-mongo
environment:
MONGO_INITDB_DATABASE: mmcat_server_data
MONGO_INITDB_ROOT_USERNAME: mmcat_user
MONGO_INITDB_ROOT_PASSWORD: mmcat_password
ports:
- "5446:27017"
volumes:
- mmcat-mongo-data:/data/db
# Mounting a .js script into the /docker-entrypoint-initdb.d/ directory will run it automatically against MONGO_INITDB_DATABASE
- ./evolution-management/server/src/main/resources/setupMongodb.js:/docker-entrypoint-initdb.d/setupMongodb.js
networks:
- mmcat
# Adminer instance for easy access to the Postgres/Mongo DBs
# (NOTE: you have to use the Docker container names and ports when connecting
# with Adminer, since it's the Adminer container which is connecting to the
# DBs. For example use `mmcat-postgres`, not `localhost:5444`.)
mmcat-adminer:
image: dockette/adminer:full
container_name: mmcat-adminer
ports:
- "27300:80"
networks:
- mmcat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment