Last active
February 17, 2023 07:05
-
-
Save TylerSustare/1947a5cea9e2b8ac5ac79d714e522576 to your computer and use it in GitHub Desktop.
Postgres, Mongo, DynamoDB, and Redis Docker compose. Just start 'em all and see what happens.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspiration | |
# https://dev.to/pfreitag/running-postgresql-in-docker-for-local-dev-2ojk | |
# https://medium.com/faun/managing-mongodb-on-docker-with-docker-compose-26bf8a0bbae3 | |
# https://rharshad.com/dynamodb-local-docker/ | |
# https://docs.fauna.com/fauna/current/integrations/dev.html#requirements | |
# instructions | |
# 1. start 'em up | |
# docker-compose up -d | |
# 2. stop them | |
# docker-compose stop | |
# 3. delete 'em. Will also delete data on the container | |
# docker-compose down | |
version: '3.7' | |
services: | |
mysql: | |
# still need to `brew install mysql` for the `mysql2` gem etc. | |
container_name: "mysql" | |
image: mysql:latest | |
ports: | |
- "3306:3306" | |
environment: | |
# - "MYSQL_ROOT_PASSWORD=${DB_PASS}" # using an environment variable | |
- MYSQL_ALLOW_EMPTY_PASSWORD=yes | |
- "MYSQL_ROOT_PASSWORD=" | |
- "MYSQL_DATABASE=app_development" | |
volumes: | |
# - ./mysql:/docker-entrypoint-initdb.d/ # file | |
- local-data:/mysql/docker-entrypoint-initdb.d/ # container | |
pg: | |
# still need to `brew install postgresql` for the `pg` gem etc. | |
container_name: 'pg' | |
image: postgres:latest | |
ports: | |
- "5432:5432" | |
environment: | |
# - "POSTGRES_PASSWORD=${DB_PASS}" # using an environment variable | |
- "POSTGRES_PASSWORD=test1234" | |
volumes: | |
# - ./pg:/docker-entrypoint-initdb.d/ # file | |
- local-data:/pg/docker-entrypoint-initdb.d/ # container | |
mongo: | |
container_name: 'mongo' | |
image: mongo:latest | |
environment: | |
MONGO_INITDB_ROOT_USERNAME: root | |
MONGO_INITDB_ROOT_PASSWORD: rootpassword | |
ports: | |
- 27017:27017 | |
volumes: | |
# - ./mongo:/data/db # file | |
- local-data:/mongo/data/db # container | |
dynamo: | |
container_name: 'ddb' | |
image: amazon/dynamodb-local:latest | |
ports: | |
- "8000:8000" | |
# localhost:8000/shell | |
command: ["-jar", "DynamoDBLocal.jar", "-sharedDb", "-inMemory"] | |
redis: | |
container_name: 'redis' | |
image: redis | |
ports: | |
- '6379:6379' | |
volumes: | |
local-data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment