我是docker的新用户,可能我搞砸了一些简单的东西。
我正在将我使用过的phpdocker.io容器化为CodeIgniter应用程序。生成的docker-compose是我正在使用的那个。
这种容器化的计划是,当另一个开发人员触摸代码时,除了简单的docker-compose up
之外,他无所事事,并且被代码弄脏了。这些项目正在使用一些google maps api,它要求我们在本地计算机(在本例中为容器)上安装SSL。
我正在使用nginx-proxy
将本地虚拟主机映射到容器,并且可以很好地工作,当我尝试安装SSL证书时出现问题。
这是我完整的docker-compose.yml
version: "3.1"
services:
###nginx-proxy###
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
- ssl-data:/etc/nginx/certs:ro
- ssl-data:/etc/nginx/vhost.d
- ssl-data:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"
###letsencrypt###
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
volumes:
- ssl-data:/etc/nginx/certs:rw
- ssl-data:/etc/nginx/vhost.d
- ssl-data:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- nginx-proxy
######mysql######
mysql:
image: mysql:5.7.21
container_name: rocatienda-mysql
working_dir: /application
volumes:
- ./app:/application
- ./mysql_data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_DATABASE=roca-tienda
- MYSQL_PASSWORD=123456
ports:
- "3306:3306"
depends_on:
- letsencrypt
whoami:
image: jwilder/whoami
environment:
- VIRTUAL_HOST=whoami.local
depends_on:
- letsencrypt
####webserver####
webserver:
image: nginx:alpine
container_name: rocatienda-webserver
working_dir: /application
volumes:
- ./app:/application
- ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
environment:
- VIRTUAL_HOST=rocatienda.local
- LETSENCRYPT_HOST=rocatienda.local
- LETSENCRYPT_EMAIL=some@example.com # this is just for this issue. I have a real email here.
depends_on:
- letsencrypt
#####php-fpm#####
php-fpm:
build: phpdocker/php-fpm
container_name: rocatienda-php-fpm
working_dir: /application
volumes:
- ./app:/application
- ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php5/fpm/conf.d/99-overrides.ini
depends_on:
- letsencrypt
volumes:
ssl-data:
这是我的项目文件夹结构:
/roca
|-- /app
|-- /mysql_data
|-- /phpdocker
| |-- /nginx
| | `-- nginx.conf
| `-- /php-fpm
| |-- Dockerfile
| `-- php-ini-overrides.ini
`-- docker-compose.yml
这些是docker-letsencrypt-nginx-proxy-companion
容器的日志:
Generating a 4096 bit RSA private key
...............................................................................................................................................................++
.............................................................................++
writing new private key to '/etc/nginx/certs/default.key.new'
-----
Info: a default key and certificate have been created at /etc/nginx/certs/default.key and /etc/nginx/certs/default.crt.
Info: Creating Diffie-Hellman group in the background.
A pre-generated Diffie-Hellman group will be used for now while the new one
is being created.
Generating DH parameters, 2048 bit long safe prime, generator 2
Reloading nginx proxy (ee253de258e33e38026a4e872a0863faf4b03a27f81e8b312941dc9a905fafd4)...
2018/10/09 18:15:57 Generated '/etc/nginx/conf.d/default.conf' from 6 containers
2018/10/09 18:15:57 [notice] 84#84: signal process started
2018/10/09 18:15:57 Generated '/app/letsencrypt_service_data' from 6 containers
2018/10/09 18:15:57 Running '/app/signal_le_service'
2018/10/09 18:15:57 Watching docker events
2018/10/09 18:15:57 Contents of /app/letsencrypt_service_data did not change. Skipping notification '/app/signal_le_service'
/etc/nginx/certs/rocatienda.local /app
Reloading nginx proxy (ee253de258e33e38026a4e872a0863faf4b03a27f81e8b312941dc9a905fafd4)...
2018/10/09 18:15:58 Generated '/etc/nginx/conf.d/default.conf' from 6 containers
Creating/renewal rocatienda.local certificates... (rocatienda.local)
2018-10-09 18:15:58,957:INFO:simp_le:1382: Generating new account key
2018-10-09 18:16:01,125:INFO:simp_le:1407: By using simp_le, you implicitly agree to the CA's terms of service: https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf
ACME server returned an error: urn:acme:error:malformed :: The request message was malformed :: Error creating new authz :: Name does not end in a public suffix
Debugging tips: -v improves output verbosity. Help is available under --help.
/app
stat: can't stat '/etc/nginx/certs/accounts/acme-v01.api.letsencrypt.org/directory/default.json': No such file or directory
chown: /etc/nginx/certs/accounts/acme-v01.api.letsencrypt.org/directory/default.json: No such file or directory
stat: can't stat '/etc/nginx/certs/accounts/acme-v01.api.letsencrypt.org/directory': No such file or directory
chown: /etc/nginx/certs/accounts/acme-v01.api.letsencrypt.org/directory: No such file or directory
stat: can't stat '/etc/nginx/certs/accounts/acme-v01.api.letsencrypt.org': No such file or directory
chown: /etc/nginx/certs/accounts/acme-v01.api.letsencrypt.org: No such file or directory
stat: can't stat '/etc/nginx/certs/accounts': No such file or directory
chown: /etc/nginx/certs/accounts: No such file or directory
Sleep for 3600s
This is going to take a long time
Info: Diffie-Hellman group creation complete, reloading nginx.
Reloading nginx proxy (ee253de258e33e38026a4e872a0863faf4b03a27f81e8b312941dc9a905fafd4)...
2018/10/09 18:16:55 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification ''
您可以看到日志底部有错误。我有一些问题:
提前谢谢!