docker-compose // piwik //运行期间出错

我尝试将所有的应用程序切换到docker工人。

configuration:

我用nginx作为服务器。 docker工人将使用它作为代理:

# nginx -v nginx version: nginx/1.4.6 (Ubuntu) 

Docker版本:

 # docker version Client: Version: 1.11.1 API version: 1.23 Go version: go1.5.4 Git commit: 5604cbe Built: Tue Apr 26 23:30:23 2016 OS/Arch: linux/amd64 Server: Version: 1.11.1 API version: 1.23 Go version: go1.5.4 Git commit: 5604cbe Built: Tue Apr 26 23:30:23 2016 OS/Arch: linux/amd64 # docker-compose -version docker-compose version 1.7.1, build 0a9ab35 

安装:

要安装piwik,我使用这里的文件build议: indiehosters / piwik

但我做了一些改变,因为我想: – 我想使用自定义数据库,所以我configuration了一个额外的用户和密码。 – 我想通过应用程序使用不同的容器的MySQL,所以我改变分贝到piwik_db(我不知道这是一个很好的做法) – 我想获得一个phpmyadmin访问,但我不明白,使其工作的重点所以我删除了configuration部分。

所以我的docker工人看起来像这样:

 piwik_db: image: mysql volumes: - ./mysql/runtime:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: P@ssR00t MYSQL_DATABASE: analytics MYSQL_USER: admin MYSQL_PASSWORD: P@ssUser app: image: piwik links: - piwik_db:mysql volumes: - ./config:/var/www/html/config - ./ssmtp.conf:/etc/ssmtp/ssmtp.conf - ./revaliases:/etc/ssmtp/revaliases web: image: nginx volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro - ./etc/letsencrypt:/etc/letsencrypt links: - app volumes_from: - app ports: - "8000:443" cron: image: piwik links: - piwik_db:mysql volumes_from: - app entrypoint: | bash -c 'bash -s <<EOF trap "break;exit" SIGHUP SIGINT SIGTERM while /bin/true; do su -s "/bin/bash" -c "/usr/local/bin/php /var/www/html/console core:archive" www-data sleep 3600 done EOF' 

结果:

当我运行docker-compose up ,它完成了一个错误:

 ERROR: for web rpc error: code = 2 desc = "oci runtime error: could not synchronise with container process: not a directory" Traceback (most recent call last): File "<string>", line 3, in <module> File "compose/cli/main.py", line 63, in main AttributeError: 'ProjectError' object has no attribute 'msg' docker-compose returned -1 

当我testing哪些容器安装,我得到

 # docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f0388c2a89d3 piwik "bash -c 'bash -s <<E" About a minute ago Up 59 seconds 9000/tcp htdocs_cron_1 ef5d6c8c6e74 mysql "docker-entrypoint.sh" About a minute ago Up About a minute 3306/tcp htdocs_piwik_db_1 

为什么我得到错误? 如何实现安装? 如何使应用程序始终运行?

预先感谢您的任何帮助。


Ps:我仍然在站点上使用我的nginxconfiguration:

 server { listen 80; listen [::]:80; server_name piwik.domain.com; # Redirige le HTTP vers le HTTPS # return 301 https://$server_name$request_uri; } server { ## # config SSL ## listen 443 ssl; ssl_certificate /etc/letsencrypt/live/piwik.domain.com.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/piwik.domain.com.com/privkey.pem; keepalive_timeout 70; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; fastcgi_param HTTPS on; # add Strict-Transport-Security to prevent man in the middle attacks add_header Strict-Transport-Security "max-age=31536000"; server_name piwik.domain.com.com; server_name_in_redirect off; root /usr/share/nginx/html/piwik.domain.com.com/htdocs; index index.php index.html index.htm; # Logs access_log /var/log/analytics.access_log; error_log /var/log/analytics.error_log; # Default location settings location / { try_files $uri $uri/ /index.php?$args; charset utf-8; client_max_body_size 20M; } # Images and static content is treated different location ~* ^.+.(js|css|png|jpg|jpeg|gif|ico|html|woff|woff2|ttf|svg|eot|otf)$ { add_header Access-Control-Allow-Origin *; expires 360d; access_log off; add_header Cache-Control "public"; } # Deny access to .htaccess files, if Apache's document root location ~ /\.ht { deny all; } location ~ /(libraries|setup/frames|setup/libs) { deny all; return 404; } # Pass the PHP scripts to FastCGI server location ~* \.php$ { # Prevent Zero-day exploit try_files $uri =404; # fastcgi_split_path_info ^(.+?\.php)(/.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } # Redirect server error pages to the static page error_page 403 /403.html; error_page 404 /404.html; error_page 500 502 503 504 /50x.html; # Exclude from the logs to avoid bloating when it's not available include drop.conf; } 

在我的情况下,问题是因为在撰写文件它试图挂载文件而不是文件夹,改变它解决了这个问题