Skip to content

Instantly share code, notes, and snippets.

@elithecho
Created August 7, 2022 02:19
Show Gist options
  • Save elithecho/8f61558b3bb0f0dbbde11f6de33d725b to your computer and use it in GitHub Desktop.
Save elithecho/8f61558b3bb0f0dbbde11f6de33d725b to your computer and use it in GitHub Desktop.
Docker compose setup
services:
app:
build:
context: ./
dockerfile: Dockerfile.dev
container_name: mapp_container
ports:
- 3000:3000
volumes:
- ./:/app
- bundler_gems:/usr/local/bundle/
# - yarn_cache:/home/node/.cache/yarn
tty: true
stdin_open: true
networks:
- application
command: bin/dev
env_file: .env
redis:
image: redis:6.2-alpine
container_name: mapp_redis
command: redis-server
networks:
- application
volumes:
- $PWD/redis-data:/var/lib/redis
- $PWD/redis.conf:/usr/local/etc/redis/redis.conf
ports:
- 6379:6379
restart: always
postgres:
image: postgres:14-alpine
container_name: mapp_postgres
user: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_DB: mapp_development
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432
- 5432:5432
volumes:
- postgres:/var/lib/postgresql/data:Z
# for transferring data to container
# - ./etc:/var/appdata
networks:
- application
volumes:
postgres:
bundler_gems:
networks:
application:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment