直接上docker-compose.yml文件
version: '3'
services:
typecho:
image: joyqi/typecho:1.2.0-php7.4-apache
# ports:
# - 80:80
volumes:
- ./data:/app/usr
networks:
typecho-network:
ipv4_address: 172.18.19.31
environment:
- MYSQL_HOST=172.18.19.51
- MYSQL_DATABASE=typecho
- MYSQL_USER=typecho111
- MYSQL_PASSWORD=typecho
depends_on:
- mysql
entrypoint:
- sh
- -euc
- |
cat <<EOF>>/app/config.inc.php
define('__TYPECHO_SECURE__', true);
EOF
docker-php-entrypoint /bin/sh -c 'init_typecho apache'
mysql:
image: mysql:5.7
environment:
- MYSQL_DATABASE=typecho
- MYSQL_USER=typecho
- MYSQL_PASSWORD=typecho
- MYSQL_ROOT_PASSWORD=root
networks:
typecho-network:
ipv4_address: 172.18.19.51
volumes:
- ./mysql-data:/var/lib/mysql
networks:
typecho-network:
driver: bridge
ipam:
config:
- subnet: 172.18.19.0/24
name: typecho-network