Automated docker LEMP stack integrated with letsencrypt. Uses https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion as basis.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

docker-compose.yml 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. version: '3'
  2. services:
  3. db:
  4. container_name: ${CONTAINER_DB_NAME}
  5. image: mariadb:latest
  6. restart: unless-stopped
  7. volumes:
  8. - ${DB_PATH}:/var/lib/mysql
  9. environment:
  10. MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
  11. MYSQL_DATABASE: ${MYSQL_DATABASE}
  12. MYSQL_USER: ${MYSQL_USER}
  13. MYSQL_PASSWORD: ${MYSQL_PASSWORD}
  14. php-fpm:
  15. container_name: ${CONTAINER_PHP_NAME}
  16. #image: php:7-fpm
  17. build: docker/php
  18. restart: unless-stopped
  19. volumes:
  20. - ${WEBROOT_PATH}:/var/www
  21. links:
  22. - db
  23. nginx:
  24. container_name: ${CONTAINER_NGINX_NAME}
  25. image: nginx:stable
  26. volumes:
  27. - ${WEBROOT_PATH}:/var/www
  28. - ./nginx/nginx.conf:/etc/nginx/nginx.conf
  29. - ./nginx/sites/:/etc/nginx/sites-enabled
  30. - ./nginx/conf.d/:/etc/nginx/conf.d
  31. depends_on:
  32. - php-fpm
  33. links:
  34. - php-fpm
  35. restart: unless-stopped
  36. environment:
  37. VIRTUAL_HOST: ${VIRTUAL_HOST}
  38. LETSENCRYPT_HOST: ${LETSENCRYPT_HOST}
  39. LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
  40. networks:
  41. default:
  42. external:
  43. name: ${NETWORK}