Skip to content

Instantly share code, notes, and snippets.

@ptheofan
Last active January 24, 2024 00:12
Show Gist options
  • Save ptheofan/2e622eb63a392b284ccb82b415c70887 to your computer and use it in GitHub Desktop.
Save ptheofan/2e622eb63a392b284ccb82b415c70887 to your computer and use it in GitHub Desktop.
Typesense + Mongodb
version: "3.8"
volumes:
imdb-mongodb-primary: {}
imdb-mongodb-secondary: {}
imdb-mongodb-arbiter: {}
services:
mongodb-primary:
image: mongo:latest
container_name: mongodb-primary
environment:
MONGODB_REPLICA_SET_MODE: primary
MONGODB_REPLICA_SET_KEY: replicasetkey123
ports:
- "27017:27017"
mongodb-secondary:
image: mongo:latest
container_name: mongodb-secondary
environment:
MONGODB_REPLICA_SET_MODE: secondary
MONGODB_REPLICA_SET_KEY: replicasetkey123
MONGODB_PRIMARY_HOST: mongodb-primary
MONGODB_PRIMARY_PORT_NUMBER: 27017
ports:
- "27027:27017"
mongodb-arbiter:
image: mongo:latest
container_name: mongodb-arbiter
environment:
MONGODB_REPLICA_SET_MODE: arbiter
MONGODB_REPLICA_SET_KEY: replicasetkey123
ports:
- "27037:27017"
typesense:
image: typesense/typesense:0.25.2
container_name: typesense
environment:
TYPESENSE_API_KEY: my-api-key
TYPESENSE_DATA_DIR: /data/typesense
TYPESENSE_ENABLE_CORS: "true"
ports:
- "8108:8108"
volumes:
- ./typesense:/data/typesense
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment