Skip to content

Instantly share code, notes, and snippets.

@RyanRosario
Created April 9, 2022 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanRosario/9e2e80c0391adbd661ec66b78a09ceec to your computer and use it in GitHub Desktop.
Save RyanRosario/9e2e80c0391adbd661ec66b78a09ceec to your computer and use it in GitHub Desktop.
# UCLA COMPUTER SCIENCE 143
# Spring 2022, Prof. Rosario
#
# Docker services for Postgres, MongoDB, Redis, Neo4j
# And a few other DBs you may want to try: CockroachDB, MariaDB, Memcached
#
# Goes well with these docker-compose networking/ingress container examples:
# https://gist.github.com/pirate/1996d3ed6c5872b1b7afded250772f7c
version: '2.4'
services:
postgres:
image: postgres:alpine
expose:
- 5432
ports:
- "5432:5432"
environment:
POSTGRES_USER: cs143
POSTGRES_PASSWORD: databases
volumes:
- ./data/postgres:/var/lib/postgresql/data
- ~/cs143_shared:/home/shared
cpus: 2
mem_limit: 4096m
mariadb:
image: mariadb:latest
expose:
- 3306
environment:
MYSQL_DATABASE: cs143
MYSQL_USER: cs143
MYSQL_PASSWORD: databases
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- ./data/mariadb:/var/lib/mysql
cpus: 2
mem_limit: 4096m
redis:
image: redis:alpine
command: redis-server --appendonly yes
expose:
- 6379
volumes:
- ./data/redis:/data
memcached:
image: memcached:latest
expose:
- 11211
mongodb:
image: mongo:latest
expose:
- 27017
volumes:
- ./data/mongodb:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: cs143
MONGO_INITDB_ROOT_PASSWORD: databases
neo4j:
image: neo4j:latest
expose:
- 7474 # HTTP API
- 7687 # BOLT API
environment:
NEO4J_AUTH: none
volumes:
- ./data/neo4j:/data:Z
cockroachdb:
image: cockroachdb/cockroach:latest
command: start --insecure
hostname: cockroachdb_node_1
expose:
- 26257 # inter-cluster communication
- 8080 # DB console web UI
volumes:
- ./data/cockroachdm:/cockroach/cockroach-data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment