From docker-compose to rancher

Hi everyone,

I’m quite new with Rancher, I read a lot of tutorials and documentation, and already made some cool things :wink:

I successfully use this article https://tech.acseo.co/sites-https-docker-nginx-lets-encrypt/ to deploy some wordpress website with ssl. It’s work perfect with this 2 docker-compose.yml

first :

nginx-proxy:
restart: always
image: jwilder/nginx-proxy
ports:
    - "80:80"
    - "443:443"
volumes:
    - /srv/docker/nginx/certs:/etc/nginx/certs:ro
    - /etc/nginx/vhost.d
    - /usr/share/nginx/html
    - /var/run/docker.sock:/tmp/docker.sock:ro

nginx-proxy-companion:
image: jrcs/letsencrypt-nginx-proxy-companion
volumes:
    - /srv/docker/nginx/certs:/etc/nginx/certs:rw
    - /var/run/docker.sock:/var/run/docker.sock
volumes_from:
    - nginx-proxy

second :

db:
  image: mariadb
  environment:
    - MYSQL_ROOT_PASSWORD=MOTDEPASSEADEFINIR
wordpress:
  image: wordpress
  links:
    - db:mysql
  environment:
    - VIRTUAL_HOST=site1.url.fr
    - LETSENCRYPT_HOST=site1.url.fr
    - LETSENCRYPT_EMAIL=contact@url.fr 

But now I tried rancher to do it.
I tried to simply upload the docker.compose.yml files in 2 différents stack

the “wordpress” stack seems ok, but with the “nginx-proxy” I have this error :

Error (Bad response statusCode [422]. Status [422 status code 422]. Body: [fieldName=LaunchConfigName, baseType=error, code=InvalidReference] from [http://localhost:8080/v2-beta/projects/1a5/services])

And only one container is created.

Any idea why ?

Regards

I think you need to make the nginx-proxy-companion a sidekick of nginx-proxy using labels as follows:

nginx-proxy:
  labels:
    io.rancher.sidekicks: nginx-proxy-companion
  ...

More info is on this issue: https://github.com/rancher/rancher/issues/1353#issuecomment-116289108.

thanks, it’s work! ( but I have now another problem… i think network issue… i will go further)