Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lanseyujie/docker-lnmp
一键 Docker LNMP 环境
https://github.com/lanseyujie/docker-lnmp
alpine docker docker-compose lnmp mariadb nginx php redis
Last synced: about 4 hours ago
JSON representation
一键 Docker LNMP 环境
- Host: GitHub
- URL: https://github.com/lanseyujie/docker-lnmp
- Owner: lanseyujie
- License: mit
- Created: 2018-09-13T05:14:25.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-01-29T07:15:46.000Z (10 months ago)
- Last Synced: 2024-01-29T09:25:00.558Z (10 months ago)
- Topics: alpine, docker, docker-compose, lnmp, mariadb, nginx, php, redis
- Language: Dockerfile
- Homepage:
- Size: 446 KB
- Stars: 6
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-lnmp
[![Build Docker LNMP Images](https://github.com/lanseyujie/docker-lnmp/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/lanseyujie/docker-lnmp/actions/workflows/build.yml)
## Usage
```shell
# Clone
git clone https://github.com/lanseyujie/docker-lnmp.git && cd docker-lnmp# Build & Start
docker compose up -d# Stop & Remove
docker compose down# Start
docker compose start# Restart
docker compose restart# Stop
docker compose stop# Logs
docker compose logs
```## SSL Deploy
```shell
# install acme.sh
curl https://get.acme.sh | sh# register account
acme.sh --register-account -m [email protected]# set api key and secret
# see https://github.com/Neilpang/acme.sh/wiki/dnsapi
export Ali_Key="12345678"
export Ali_Secret="abcdefg"# issue a certificate by validating DNS TXT records
# see https://github.com/Neilpang/acme.sh/wiki/%E8%AF%B4%E6%98%8E
export TLD=example.com
acme.sh --issue --dns dns_ali -d "$TLD" -d "*.$TLD"# install the certificate and update it automatically
acme.sh --install-cert \
-d "$TLD" \
-d "*.$TLD" \
--key-file "$(pwd)/nginx/ssl/$TLD.key" \
--fullchain-file "$(pwd)/nginx/ssl/$TLD.cer" \
--reloadcmd "docker restart nginx"
```## Other
```shell
# PHP Built-in HTTP Server
docker run -it --rm -p 8080:8080 -v $(pwd):/data/ docker-lnmp-php:latest sh -c "php -S 0.0.0.0:8080 -t /data"# Auto Backup Database
cd docker-lnmp && crontab -l | {
cat
echo "0 3 * * * $(pwd)/script/autobak.sh -uroot -p123456 -dwww > /dev/null"
} | crontab -
```