Skip to content

Instantly share code, notes, and snippets.

@Xeckt
Last active June 17, 2022 12:27
Show Gist options
  • Save Xeckt/7272aeeb0e18b8b5bed5aa74d99396be to your computer and use it in GitHub Desktop.
Save Xeckt/7272aeeb0e18b8b5bed5aa74d99396be to your computer and use it in GitHub Desktop.
Docker Compose YML LEMP Stack
version: '3.2'
services:
website:
image: 'nginx:1.15.1-alpine'
ports:
- '123.23.43.54:80:80'
- '123.23.43.54:443:443'
volumes:
- type: bind
source: /path/to/website/folder
target: /var/www/default/
- './nginx_config/nginx.conf:/etc/nginx/nginx.conf'
- './nginx_config/website.conf:/etc/nginx/conf.d/website.conf'
- './nginx_config/mime.types:/etc/nginx/mime.types'
- './SSL/:/etc/nginx/ssl/'
networks:
production:
ipv4_address: 172.50.1.5
website_php:
build:
context: .
dockerfile: dockerfiles/php-dockerfile
volumes:
- type: bind
source: /path/to/website
target: /var/www/default/
- './php_config/php.ini:/usr/local/etc/php/php.ini'
networks:
production:
ipv4_address: 172.50.1.3
website_sql:
image: 'mysql:8.0.17'
ports:
- '123.123.123.123:3306:3306'
environment:
- MYSQL_ROOT_PASSWORD=enjoythegist
volumes:
- 'sql-volume-name:/var/lib/mysql'
command:
- '--skip-mysqlx'
networks:
production:
ipv4_address: 172.50.1.4
networks:
production:
ipam:
driver: default
config:
- subnet: 172.50.0.0/16
volumes:
sql-volume-name: null
external: true # This is used if you have created a volume outside of the container with `docker volume create`, remove this if you want compose to create and use one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment