Skip to content

Instantly share code, notes, and snippets.

@Neirda24
Last active October 18, 2022 10:40
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 Neirda24/ffdb8dee99a5bc82fc577f55be05a80e to your computer and use it in GitHub Desktop.
Save Neirda24/ffdb8dee99a5bc82fc577f55be05a80e to your computer and use it in GitHub Desktop.
multiple docker-compose structure (light)
services:
nginx:
networks:
traefik:
aliases:
- 'local.app'
labels:
traefik.enable: 'true'
traefik.http.services.myapp.loadbalancer.server.port: '80'
traefik.http.routers.myapp.rule: 'Host(`local.app`)'
traefik.http.routers.myapp.entrypoints: 'web-secure'
traefik.http.routers.myapp.tls: 'true'
networks:
traefik:
external: true
name: 'traefik'
services:
pgsql:
image: 'postgres:14.5'
restart: 'unless-stopped'
volumes:
-
type: 'volume'
source: 'pgsql'
target: '/var/lib/postgresql/data'
tty: true
env_file:
- './pgsql.env'
ports:
-
target: 5432
published: 5432
protocol: 'tcp'
mode: 'host'
php:
depends_on:
- 'pgsql'
volumes:
-
type: 'bind'
source: '/home/me/project'
target: '/var/www/html'
-
type: 'bind'
source: '~/.ssh'
target: '/var/www/.ssh'
read_only: true
-
type: 'bind'
source: '~/.composer'
target: '/var/www/.composer'
nginx:
volumes:
-
type: 'bind'
source: '/home/me/project'
target: '/var/www/html'
node:
image: 'node:latest'
user: 'node'
working_dir: '/var/www/html'
volumes:
-
type: 'bind'
source: '/home/me/project'
target: '/var/www/html'
-
type: 'bind'
source: '~/.ssh'
target: '/home/node/.ssh'
read_only: true
-
type: 'bind'
source: '~/.cache/yarn'
target: '/home/node/.cache/yarn'
restart: 'unless-stopped'
tty: true
volumes:
pgsql:
services:
php:
image: 'php:8.1'
restart: 'unless-stopped'
env_file:
- './php.env'
tty: true
nginx:
image: 'nginx:latest'
restart: 'unless-stopped'
working_dir: '/var/www/html'
env_file:
- './nginx.env'
depends_on:
- 'php'
tty: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment