From fb25a4d56bb3e3906d85dac07dc4259e988d36ba Mon Sep 17 00:00:00 2001 From: linus Date: Wed, 12 Jan 2022 11:24:20 +0100 Subject: [PATCH] migrate to cont2.noris --- .drone.yml | 74 +++++++++++++++++++++++----------------------- docker-compose.yml | 13 +++++--- 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2f14063..8323f56 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,50 +1,50 @@ --- kind: pipeline name: default -type: docker steps: -- name: copy-sigs - image: alpine:3 - commands: - - cp /tmp/signatures.json site/data/signatures/signatures.json - volumes: - - name: signatures - path: /tmp/signatures.json + - name: copy-sigs + image: alpine:3 + commands: + - cp /tmp/signatures.json site/data/signatures/signatures.json + volumes: + - name: signatures + path: /tmp/signatures.json -- name: hugo - image: plugins/hugo - settings: - source: site - validate: true + - name: hugo + image: plugins/hugo + settings: + source: site + validate: true -- name: deploy - image: docker/compose:1.29.1 - commands: - - docker-compose -p pmpc-website up --build -d - volumes: - - name: dockersock - path: /var/run/docker.sock - when: - branch: - - master - event: - - push - - tag - - deployment - - cron + - name: deploy + image: docker/compose:1.29.2 + environment: + XDG_RUNTIME_DIR: "/run/user/1001" + DOCKER_HOST: "unix:///run/user/1001/docker.sock" + commands: + - docker-compose -p pmpc-website up --build -d + volumes: + - name: dockersock + path: /run/user/1001/docker.sock + when: + branch: + - master + event: + - push + - tag + - deployment + - cron # This has to run on the same machine as the forms API until this feature # exists: https://git.fsfe.org/fsfe-system-hackers/forms/issues/62 node: - cont: lund + cont2: noris volumes: -- name: dockersock - host: - path: /var/run/docker.sock -- name: signatures - host: - path: /srv/forms/pmpc/signatures.json - -... + - name: dockersock + host: + path: /run/user/1001/docker.sock + - name: signatures + host: + path: /srv/forms/pmpc/signatures.json diff --git a/docker-compose.yml b/docker-compose.yml index 61fafb2..0d12f8c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,5 @@ -version: '3' +version: "3" services: - pmpc: container_name: pmpc build: . @@ -16,13 +15,19 @@ services: - VIRTUAL_PORT=8080 - LETSENCRYPT_HOST=publiccode.eu,www.publiccode.eu - LETSENCRYPT_EMAIL=contact@fsfe.org + ports: + - "50:8080" + labels: + proxy.host: "publiccode.eu" + proxy.host_alias: "www.publiccode.eu" + proxy.port: "50" # Connect the container which exposes the service to the 'bridge' network as # this is where the reverse proxy is connect-bridge: image: docker:dind volumes: - - /var/run/docker.sock:/var/run/docker.sock + - /run/user/1001/docker.sock:/var/run/docker.sock depends_on: - - pmpc + - pmpc command: sh -c 'docker network connect bridge pmpc'