Last active
September 27, 2019 12:39
-
-
Save oktavianto/15e674b2c3a5a70482cda5fa40f41358 to your computer and use it in GitHub Desktop.
This file contains 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
version: '3' | |
services: | |
#PHP Service | |
app: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
image: digitalocean.com/php | |
container_name: ${PROJECT_NAME}-app | |
restart: unless-stopped | |
tty: true | |
environment: | |
SERVICE_NAME: app | |
SERVICE_TAGS: dev | |
working_dir: /var/www/${PROJECT_NAME} | |
networks: | |
- app-network | |
#Nginx Service | |
webserver: | |
image: nginx:alpine | |
container_name: ${PROJECT_NAME}-webserver | |
restart: unless-stopped | |
tty: true | |
ports: | |
- "80:80" | |
- "443:443" | |
networks: | |
- app-network | |
#PgSQL Service | |
db: | |
image: postgres:latest | |
container_name: ${PROJECT_NAME}-db | |
restart: unless-stopped | |
tty: true | |
ports: | |
- "5432:5432" | |
volumes: | |
- "./sourcefiles/postgres:/var/lib/postgresql/data" | |
environment: | |
POSTGRES_DB: ${DB_DATABASE} | |
POSTGRES_USER: ${DB_USERNAME} | |
POSTGRES_PASSWORD: ${DB_PASSWORD} | |
networks: | |
- app-network | |
redis: | |
image: redis:alpine | |
container_name: ${PROJECT_NAME}-redis | |
#Docker Networks | |
networks: | |
app-network: | |
driver: bridge | |
#Volumes | |
volumes: | |
dbdata: | |
driver: local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment