Skip to content

Instantly share code, notes, and snippets.

@jrschumacher
Created January 16, 2015 18:03
Show Gist options
  • Save jrschumacher/58e5189942f28053a9e1 to your computer and use it in GitHub Desktop.
Save jrschumacher/58e5189942f28053a9e1 to your computer and use it in GitHub Desktop.
docker latest no port issue
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
32b9ac00b8fa dokku/coach:latest "/bin/bash -c '/star About an hour ago Up About an hour determined_bardeen
ed13cc0c60b6 dokku/helloworld:latest "/bin/bash -c '/star About an hour ago Up About an hour 0.0.0.0:49154->5000/tcp dreamy_hopper
@jrschumacher
Copy link
Author

cat dokku.conf
include /home/dokku/*/nginx.conf;

ssl_session_cache shared:SSL:20m;
ssl_session_timeout 10m;

ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!CAMELLIA;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_prefer_server_ciphers on;

#ssl_certificate /home/dokku/tls/server.crt;
#ssl_certificate_key /home/dokku/tls/server.key;

@jrschumacher
Copy link
Author

$ ls -lah /home/dokku/*/nginx.conf
-rw-rw-r-- 1 dokku dokku 576 Jan 16 13:35 /home/dokku/coach2/nginx.conf
-rw-rw-r-- 1 dokku dokku 592 Jan 16 13:16 /home/dokku/coach/nginx.conf
-rw-rw-r-- 1 dokku dokku 592 Jan 16 11:14 /home/dokku/helloworld/nginx.conf
-rw-rw-r-- 1 dokku dokku 592 Jan 16 12:55 /home/dokku/whiteboard/nginx.conf

@jrschumacher
Copy link
Author

$ git clone [email protected]:ruedap/node-hello-world.git
$ git remote add deploy [email protected]:test
$ git push deploy master
$ git commit --allow-empty -m "test"

$ git push deploy master
$ git commit --allow-empty -m "test"

$ git push deploy master
$ git commit --allow-empty -m "test"
$ docker ps
CONTAINER ID        IMAGE                     COMMAND                CREATED              STATUS              PORTS                     NAMES
38a6de59dfe6        dokku/test:latest         "/bin/bash -c '/star   1 seconds ago        Up 1 seconds                                  romantic_sinoussi
b16be6c5dae3        5b515d9a4ac8              "/bin/bash -c '/star   36 seconds ago       Up 36 seconds                                 grave_perlman
ebe8d2db6fe6        09e1e1c2cda3              "/bin/bash -c '/star   About a minute ago   Up About a minute                             prickly_jones

@jrschumacher
Copy link
Author

$ grep coach2.xxx.pw /home/dokku/*/nginx.conf
/home/dokku/coach2/nginx.conf:  server_name coach2.xxx.pw ;
$ grep -r coach2.xxx.pw /etc/nginx/

@jrschumacher
Copy link
Author

/etc/nginx/conf.d/dokku.conf:include /home/dokku/*/nginx.conf;
/etc/nginx/snippets/fastcgi-php.conf:include fastcgi.conf;
/etc/nginx/nginx.conf.dpkg-old:  include /etc/nginx/mime.types;
/etc/nginx/nginx.conf.dpkg-old:  include /etc/nginx/conf.d/*.conf;
/etc/nginx/nginx.conf.dpkg-old:  include /etc/nginx/sites-enabled/*;
/etc/nginx/nginx.conf:  include /etc/nginx/mime.types;
/etc/nginx/nginx.conf:  include /etc/nginx/conf.d/*.conf;
/etc/nginx/nginx.conf:  include /etc/nginx/sites-enabled/*;
/etc/nginx/sites-available/default: # include snippets/snakeoil.conf;
/etc/nginx/sites-available/default: #   include snippets/fastcgi-php.conf;

@jrschumacher
Copy link
Author

cat /home/dokku/*/nginx.conf
upstream coach2 { server 172.17.0.57:5000; }
server {
  listen      [::]:80;
  listen      80;
  server_name coach2.xxx.pw ;
  location    / {
    proxy_pass  http://coach2;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection upgrade;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Request-Start $msec;
  }
  include /home/dokku/coach2/nginx.conf.d/*.conf;
}
upstream coach { server 172.17.0.39:5000; }
server {
  listen      [::]:80;
  listen      80;
  server_name coach.xxx.pw coach.thebaydoor.com;
  location    / {
    proxy_pass  http://coach;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection upgrade;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Request-Start $msec;
  }
  include /home/dokku/coach/nginx.conf.d/*.conf;
}
upstream helloworld { server 127.0.0.1:49154; }
server {
  listen      [::]:80;
  listen      80;
  server_name helloworld.xxx.pw;
  location    / {
    proxy_pass  http://helloworld;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Request-Start $msec;
  }
  include /home/dokku/helloworld/nginx.conf.d/*.conf;
}
upstream test { server 172.17.0.75:5000; }
server {
  listen      [::]:80;
  listen      80;
  server_name test.xxx.pw ;
  location    / {
    proxy_pass  http://test;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection upgrade;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Request-Start $msec;
  }
  include /home/dokku/test/nginx.conf.d/*.conf;
}
upstream whiteboard { server 172.17.0.26:5000; }
server {
  listen      [::]:80;
  listen      80;
  server_name whiteboard.xxx.pw ;
  location    / {
    proxy_pass  http://whiteboard;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection upgrade;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Request-Start $msec;
  }
  include /home/dokku/whiteboard/nginx.conf.d/*.conf;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment