Paweł Malicki 3 時間 前
コミット
3611116691
4 ファイル変更75 行追加0 行削除
  1. 28 0
      .drone.yml
  2. 5 0
      .env
  3. 18 0
      .yamllint.yaml
  4. 24 0
      docker-compose.yml

+ 28 - 0
.drone.yml

@@ -0,0 +1,28 @@
+---
+kind: pipeline
+type: docker
+name: default
+
+steps:
+
+  - name: yamlint the config
+    pull: if-not-exists
+    image: sdesbure/yamllint
+    commands:
+      - yamllint -c .yamllint.yaml .
+
+  - name: verify config, update image and upgrade images
+    pull: if-not-exists
+    image: docker:rc-cli
+    environment:
+      DEPLOY_HOST: pve0.progresnet.com.pl
+      DEPLOY_USER: deploy
+      DEPLOY_ADMIN_PRIV_KEY:
+        from_secret: SECRET_SSH_DRONE_PRIVKEY
+    commands:
+      - apk update && apk add -qU openssh-client
+      - mkdir ~/.ssh
+      - ssh-keyscan -H $DEPLOY_HOST >> ~/.ssh/known_hosts
+      - echo $DEPLOY_ADMIN_PRIV_KEY | base64 -d > ~/.ssh/id_rsa
+      - chmod -R 600 ~/.ssh
+      - ssh -t $DEPLOY_USER@$DEPLOY_HOST "sudo git -C /opt/docker/zwiedzanietorunia pull && sudo docker compose -f /opt/docker/zwiedzanietorunia/docker-compose.yml --env-file=/opt/docker/zwiedzanietorunia/.env"

+ 5 - 0
.env

@@ -0,0 +1,5 @@
+DEPLOY_HOST=pve0.progresnet.com.pl
+DEPLOY_DOMAIN=progresnet.com.pl
+COMPOSE_PROJECT_NAME=pve0progresnetcompl
+HOST_TIMEZONE=Europe/Warsaw
+LOGGING_HOST=10.2.0.3

+ 18 - 0
.yamllint.yaml

@@ -0,0 +1,18 @@
+---
+
+extends: default
+
+#ignore: |
+#  docker-compose.seq.yml
+
+rules:
+  # 80 chars should be enough, but don't fail if a line is longer
+  line-length:
+    max: 120
+    level: warning
+  comments:
+    require-starting-space: false
+  document-start:
+    present: true
+#    ignore: |
+#      ui-lovelace.yaml

+ 24 - 0
docker-compose.yml

@@ -0,0 +1,24 @@
+---
+services:
+  ip:
+    image: traefik/whoami
+    restart: always
+    labels:
+      - 'traefik.enable=true'
+      - 'traefik.docker.network=discovery'
+      - 'traefik.http.routers.ip.rule=Host(`ip.${DEPLOY_HOST}`)'
+      - 'traefik.http.services.ip.loadbalancer.server.port=80'
+      - 'traefik.http.routers.ip.tls.certresolver=le'
+      - 'traefik.http.routers.ip.middlewares=waf@docker'
+    networks:
+      - discovery
+    ports:
+      - '30880:80'
+    logging:
+      driver: gelf
+      options:
+        gelf-address: "udp://${LOGGING_HOST}:12201"
+
+networks:
+  discovery:
+    external: true