title: Docker:搭建短网址服务YOURLS tags: [] id: '1901' categories:
https://blog.laoda.de/archives/docker-compose-install-yourls
https://occdn.limour.top/1898.html
sudo docker-compose up -d
version: "3.5"
services:
mysql:
image: mysql:5.7.22
environment:
- MYSQL_ROOT_PASSWORD=my-secret-pw
- MYSQL_DATABASE=yourls
- MYSQL_USER=yourls
- MYSQL_PASSWORD=yourls
volumes:
- ./mysql/db/:/var/lib/mysql
- ./mysql/conf/:/etc/mysql/conf.d
restart: always
container_name: mysql
yourls:
image: yourls
restart: always
ports:
- "8200:80"
environment:
YOURLS_DB_HOST: mysql
YOURLS_DB_USER: yourls
YOURLS_DB_PASS: yourls
YOURLS_DB_NAME: yourls
YOURLS_USER: admin # 自己起一个名字
YOURLS_PASS: admin # 自己换一个登陆密码
YOURLS_SITE: https://j11.fun # 换成你自己的域名
YOURLS_HOURS_OFFSET: 8
volumes:
- ./yourls_data/:/var/www/html
container_name: yourls_service
links:
- mysql:mysql