Commit 485f07d8 authored by Romain Hunault's avatar Romain Hunault Committed by Romain Hunault

Use docker-compose for SSL

parent 42560b75
......@@ -94,7 +94,5 @@ 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 -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"
......@@ -2,12 +2,39 @@ version: '3.6'
services:
redis:
restart: unless-stopped
image: redis:5-alpine
spot:
build: .
restart: unless-stopped
environment:
SEARX_REDIS_HOST: redis
VIRTUAL_HOST: ${SPOT_HOSTNAME:-spot}
LETSENCRYPT_HOST: ${SPOT_HOSTNAME:-spot}
SEARX_LOGGER: INFO
proxy:
image: jwilder/nginx-proxy:alpine
restart: unless-stopped
container_name: proxy
volumes:
- /mnt/data/html:/usr/share/nginx/html
- /mnt/data/vhosts:/etc/nginx/vhost.d
- /mnt/data/certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
restart: unless-stopped
ports:
- "80:80"
- "443:443"
cert:
image: jrcs/letsencrypt-nginx-proxy-companion
restart: unless-stopped
environment:
NGINX_PROXY_CONTAINER: proxy
volumes:
- /mnt/data/html:/usr/share/nginx/html
- /mnt/data/vhosts:/etc/nginx/vhost.d
- /mnt/data/certs:/etc/nginx/certs
- /var/run/docker.sock:/var/run/docker.sock:ro
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