https://github.com/avin/php-hosting-docker-compose
Nginx + PHP + Mysql docker compose
https://github.com/avin/php-hosting-docker-compose
Last synced: 6 months ago
JSON representation
Nginx + PHP + Mysql docker compose
- Host: GitHub
- URL: https://github.com/avin/php-hosting-docker-compose
- Owner: avin
- Created: 2017-05-08T21:42:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-13T18:54:20.000Z (over 8 years ago)
- Last Synced: 2025-06-07T20:02:35.226Z (7 months ago)
- Language: Shell
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker php+mysql+nginx hosting container
nginx + PHP + MySQL service
## Install as systemd service
Install `docker`, `docker-compose`, `git` before
Clone repository
```
mkdir /opt -p && cd /opt
git clone https://github.com/avin/php-hosting-docker-compose.git hosting
```
Modify `docker-compose.yml` if you need.
Create `/etc/systemd/system/hosting-docker.service`:
```
[Unit]
Description=Hosting Service
After=docker.service
Requires=docker.service
[Service]
ExecStart=/usr/local/bin/docker-compose -f /opt/hosting/docker-compose.yml up --build
ExecStop=/usr/local/bin/docker-compose -f /opt/hosting/docker-compose.yml stop -t 2
[Install]
WantedBy=multi-user.target
```
Install service
```
systemctl enable hosting-docker.service
```
## Structure
* `backups/db` mysql dumps location
* `content/db` mysql db files location
* `content/site-configs` nginx configs for websites
* `content/site-files` websites files
## DB Maintenance
* `db_backup.sh` - make dumps of all mysql dbs
* `db_cli.sh` - enter mysql console