Last active
September 18, 2019 00:29
-
-
Save wilcorrea/1f9427b237f4901c4a299e1cdeb05f59 to your computer and use it in GitHub Desktop.
This file contains hidden or 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' | |
| # volumes | |
| volumes: | |
| mariadb-data: | |
| driver: local | |
| # networks | |
| networks: | |
| internal: | |
| driver: bridge | |
| #services | |
| services: | |
| # app | |
| project-app: | |
| image: webdevops/php-apache:7.3 | |
| container_name: project-app | |
| restart: always | |
| networks: | |
| - internal | |
| working_dir: /var/www/app | |
| volumes: | |
| - .:/var/www/app | |
| - /etc/letsencrypt/live/project.com/cert.pem:/opt/docker/etc/httpd/ssl/server.crt | |
| - /etc/letsencrypt/live/project.com/fullchain.pem:/opt/docker/etc/httpd/ssl/server.csr | |
| - /etc/letsencrypt/live/project.com/privkey.pem:/opt/docker/etc/httpd/ssl/server.key | |
| environment: | |
| - WEB_DOCUMENT_ROOT=/var/www/app/public | |
| ports: | |
| - 80:80 | |
| - 443:443 | |
| # database service | |
| project-database: | |
| container_name: project-database | |
| image: mariadb:10.4 | |
| restart: unless-stopped | |
| networks: | |
| - internal | |
| environment: | |
| - MYSQL_ROOT_PASSWORD=root | |
| - MYSQL_DATABASE=project | |
| - MYSQL_USER=user | |
| - MYSQL_PASSWORD=password | |
| volumes: | |
| - mariadb-data:/var/lib/mysql | |
| - .:/var/www/app |
This file contains hidden or 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
| #!/bin/bash | |
| docker run -ti --rm \ | |
| -v /etc/letsencrypt:/etc/letsencrypt \ | |
| -v /var/projects/app/public:/var/www \ | |
| webdevops/certbot /usr/bin/certbot certonly \ | |
| --agree-tos \ | |
| --webroot \ | |
| -w /var/www \ | |
| -d project.com \ | |
| -m "[email protected]" |
This file contains hidden or 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
| #!/bin/sh | |
| set -euo pipefail | |
| # Certificate reissue | |
| docker run -ti --rm \ | |
| -v /etc/letsencrypt:/etc/letsencrypt \ | |
| -v /var/projects/app/public:/var/www \ | |
| webdevops/certbot /usr/bin/certbot renew |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment