Open cenyong opened 4 years ago
docker-compose.yml如下:
version: '3.4' services: swoft: image: swoft/swoft
container_name: swoft-srv
environment: # 环境变量
- APP_ENV=dev
- TIMEZONE=Asia/Shanghai
restart: always
depends_on: #依赖,含义:启动mysql容器 和 redis 容器后 启动 swoft 容器
- mysql
- redis
ports: #端口映射 hostPort/localPort
- "4450:18306"
- "18307:18307"
- "18308:18308"
- "12346:18309"
links: #连接 链接其他容器
- mysql:mysql
- redis:redis
volumes: #挂载. 目录挂载的路径,volumes_from 可以指定挂载的容器
- /opt/swoft/data/:/var/www/swoft
# - ./runtime/ng-conf:/etc/nginx
- /opt/swoft/logs:/var/log
command: /bin/bash
mysql: image: mysql container_name: mysql-srv environment:
./runtime/data/mysql:/var/lib/mysql restart: always
redis: container_name: redis-srv image: redis:4-alpine ports:
logs: [root@localhost swoft]# docker-compose logs --tail 1000 -f Attaching to swoft-srv, mysql-srv, redis-srv mysql-srv | 2020-03-27 10:44:27+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10 started. mysql-srv | 2020-03-27 10:44:28+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' mysql-srv | 2020-03-27 10:44:28+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10 started. mysql-srv | 2020-03-27T10:44:28.842734Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release. mysql-srv | 2020-03-27T10:44:28.842891Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 1 mysql-srv | 2020-03-27T10:44:30.591176Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. mysql-srv | 2020-03-27T10:44:30.607961Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. mysql-srv | 2020-03-27T10:44:30.650370Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.19' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL. mysql-srv | 2020-03-27T10:44:30.872166Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060 redis-srv | 1:C 27 Mar 10:44:27.809 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo redis-srv | 1:C 27 Mar 10:44:27.809 # Redis version=4.0.14, bits=64, commit=00000000, modified=0, pid=1, just started redis-srv | 1:C 27 Mar 10:44:27.809 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf redis-srv | 1:M 27 Mar 10:44:27.810 Running mode=standalone, port=6379. redis-srv | 1:M 27 Mar 10:44:27.810 # Server initialized redis-srv | 1:M 27 Mar 10:44:27.811 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. redis-srv | 1:M 27 Mar 10:44:27.813 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled. redis-srv | 1:M 27 Mar 10:44:27.813 Ready to accept connections swoft-srv exited with code 0
我使用docker-compose运行,redis,mysql运行都没问题,但是swoft运行的时候没有任何日志