Skip to content

Instantly share code, notes, and snippets.

@lucasprogamer
Created June 16, 2021 13:46
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 lucasprogamer/27b6718bab1c5d04892ead65f0273a84 to your computer and use it in GitHub Desktop.
Save lucasprogamer/27b6718bab1c5d04892ead65f0273a84 to your computer and use it in GitHub Desktop.
my-default-docker-file
version: '3'
# Named volumes
volumes:
pg-container-data:
driver: local
redis-container-data:
driver: local
services:
pg:
image: postgres:11
container_name: pg-container
volumes:
- pg-container-data:/var/lib/postgresql/data
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=123
- POSTGRES_DB=docker
- POSTGRES_USER=docker
# Redis
cache:
image: redis:4.0
container_name: redis-container
command: --appendonly yes
volumes:
- redis-container-data:/data
ports:
- "6379:6379"
# PHP (with Nginx)
api:
image: ambientum/php:7.3-nginx
container_name: api-container
volumes:
- ./api/:/var/www/app
ports:
- "8081:8080"
links:
- pg
- cache
web:
image: ambientum/php:7.3-nginx
container_name: web-container
volumes:
- ./web/:/var/www/app
ports:
- "8082:8080"
links:
- pg
- cache
# Laravel Queues
queue:
image: ambientum/php:7.3
container_name: queue-container
command: php artisan queue:listen
volumes:
- ./api/:/var/www/app
links:
- pg
- cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment