Commit 42560b75 authored by Romain Hunault's avatar Romain Hunault Committed by Romain Hunault

Add support SSL on deployment

parent 116e3f9b
......@@ -94,6 +94,7 @@ deploy:test:
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- ssh -2 $PUBLISH_USER@$PUBLISH_URL 'if [ ! "$(docker ps -q -f name=proxy)" ] ; then docker run -d -p 80:80 --net my-network my-spot_default -v /var/run/docker.sock:/tmp/docker.sock:ro --restart unless-stopped --name proxy jwilder/nginx-proxy ; elif [ ! "$(docker ps -q -f name=proxy -f status=exited)" ] ; then docker start proxy ; fi'
- ssh -2 $PUBLISH_USER@$PUBLISH_URL 'if [ ! "$(docker ps -q -f name=proxy)" ] ; then docker run -d -p 80:80 -p 443:443 --net my-spot_default -v /mnt/data/html:/usr/share/nginx/html -v /mnt/data/vhosts:/etc/nginx/vhost.d -v /mnt/data/certs:/etc/nginx/certs:ro -v /var/run/docker.sock:/tmp/docker.sock:ro --restart unless-stopped --name proxy jwilder/nginx-proxy ; elif [ ! "$(docker ps -q -f name=proxy -f status=exited)" ] ; then docker start proxy ; fi'
- ssh -2 $PUBLISH_USER@$PUBLISH_URL 'docker run --name letsencrypt-proxy --volumes-from proxy -v /mnt/data/certs:/etc/nginx/certs -v /var/run/docker.sock:/var/run/docker.sock:ro --net my-spot_default -d jrcs/letsencrypt-nginx-proxy-companion'
- ssh -2 $PUBLISH_USER@$PUBLISH_URL "cd /root/my-spot/ && git fetch && git checkout $CI_COMMIT_SHA"
- ssh -2 $PUBLISH_USER@$PUBLISH_URL "SPOT_HOSTNAME=$SPOT_HOSTNAME && export SPOT_HOSTNAME && cd /root/my-spot/ && docker-compose pull && docker-compose up -d --build --force-recreate"
......@@ -9,4 +9,5 @@ services:
environment:
SEARX_REDIS_HOST: redis
VIRTUAL_HOST: ${SPOT_HOSTNAME:-spot}
LETSENCRYPT_HOST: ${SPOT_HOSTNAME:-spot}
SEARX_LOGGER: INFO
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment