[tutorial] Raspberry Pi – Docker, Proxy, Let’s Encrypt, SUPLA, SUPLA-Scripts...

User avatar
lesny8
Posts: 3132
Joined: Mon Dec 11, 2017 9:43 pm
Has thanked: 10 times
Been thanked: 9 times

Post

Pokaż plik

Code: Select all

cat ~/docker-compose-letsencrypt-nginx-proxy-companion/docker-compose.yml 
SOP 2023 :heavy_check_mark:
SOP 2024 :heavy_check_mark:
Czekam na kolejne Supla Offline Party :upside_down_face:
🧩: 🔑cz->b ⛴️+ila
groszek33
Posts: 73
Joined: Sun Feb 11, 2018 12:15 pm

Post

Code: Select all

version: '3'

services:
<<<<<<< HEAD
  nginx-proxy-automation-web:
    image: nginx:${NGINX_IMAGE_VERSION:-stable-alpine}
=======
  nginx-web:
    image: nginx:1.21.3
>>>>>>> refs/remotes/origin/master
    labels:
      com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
    container_name: ${NGINX_WEB_SEVICE_NAME:-nginx-proxy-automation-web}
    restart: always
    ports:
      - "${IPv4:-0.0.0.0}:${DOCKER_HTTP_:-80}:80"
      - "${IPv4:-0.0.0.0}:${DOCKER_HTTPS:-443}:443"
#      - "${IPv6:-::0}:${DOCKER_HTTP_:-80}:80"
#      - "${IPv6:-::0}:${DOCKER_HTTPS:-443}:443"
    environment:
      SSL_POLICY: ${SSL_POLICY:-Mozilla-Intermediate}
#      DEFAULT_HOST: ${DEFAULT_HOST}
#      ENABLE_IPV6: "true"
    volumes:
      - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
      - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d
      - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html
      - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro
      - ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro
    logging:
      driver: ${NGINX_WEB_LOG_DRIVER:-json-file}
      options:
        max-size: ${NGINX_WEB_LOG_MAX_SIZE:-4m}
        max-file: ${NGINX_WEB_LOG_MAX_FILE:-10}

<<<<<<< HEAD
  nginx-proxy-automation-gen:
    image: nginxproxy/docker-gen:${DOCKER_GEN_IMAGE_VERSION:-0.7.7}
    command: -notify-sighup ${NGINX_WEB_SEVICE_NAME:-nginx-proxy-automation-web}                                                                                         -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/defa                                                                                        ult.conf
    container_name: ${DOCKER_GEN_SEVICE_NAME:-nginx-proxy-automation-gen}
=======
  nginx-gen:
    image: lesny8/rpi-docker-gen
    command: -notify-sighup ${NGINX_WEB:-nginx-web} -watch -wait 5s:30s /etc/doc                                                                                        ker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
    container_name: ${DOCKER_GEN:-nginx-gen}
>>>>>>> refs/remotes/origin/master
    restart: always
    volumes:
      - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
      - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d
      - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html
      - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro
      - ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
    logging:
      driver: ${NGINX_GEN_LOG_DRIVER:-json-file}
      options:
        max-size: ${NGINX_GEN_LOG_MAX_SIZE:-2m}
        max-file: ${NGINX_GEN_LOG_MAX_FILE:-10}

<<<<<<< HEAD
  nginx-proxy-automation-letsencrypt:
    image: nginxproxy/acme-companion:${NGINX_PROXY_COMPANION_IMAGE_VERSION:-2.1}
    container_name: ${LETS_ENCRYPT_SEVICE_NAME:-nginx-proxy-automation-letsencry                                                                                        pt}
=======
  nginx-letsencrypt:
    image: lesny8/rpi-docker-letsencrypt-nginx-proxy-companion
    container_name: ${LETS_ENCRYPT:-nginx-letsencrypt}
>>>>>>> refs/remotes/origin/master
    restart: always
    volumes:
      - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
      - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d
      - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html
      - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:rw
      - ${NGINX_FILES_PATH:-./data}/acme.sh:/etc/acme.sh
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      NGINX_DOCKER_GEN_CONTAINER: ${DOCKER_GEN_SEVICE_NAME:-nginx-proxy-automati                                                                                        on-gen}
      NGINX_PROXY_CONTAINER: ${NGINX_WEB_SEVICE_NAME:-nginx-proxy-automation-web                                                                                        }
      DEFAULT_EMAIL: ${DEFAULT_EMAIL:[email protected]}
    logging:
      driver: ${NGINX_LETSENCRYPT_LOG_DRIVER:-json-file}
      options:
        max-size: ${NGINX_LETSENCRYPT_LOG_MAX_SIZE:-2m}
        max-file: ${NGINX_LETSENCRYPT_LOG_MAX_FILE:-10}

networks:
  default:
    external: true
    name: ${NETWORK:-proxy}
Kto pyta nie błądzi:))
User avatar
lesny8
Posts: 3132
Joined: Mon Dec 11, 2017 9:43 pm
Has thanked: 10 times
Been thanked: 9 times

Post

Code: Select all

git status
SOP 2023 :heavy_check_mark:
SOP 2024 :heavy_check_mark:
Czekam na kolejne Supla Offline Party :upside_down_face:
🧩: 🔑cz->b ⛴️+ila
groszek33
Posts: 73
Joined: Sun Feb 11, 2018 12:15 pm

Post

pi@raspberrypi:~ $ git status
fatal: Not a git repository (or any of the parent directories): .git
pi@raspberrypi:~ $
Kto pyta nie błądzi:))
User avatar
lesny8
Posts: 3132
Joined: Mon Dec 11, 2017 9:43 pm
Has thanked: 10 times
Been thanked: 9 times

Post

Ale wejdź najpierw do katalogu

Code: Select all

cd ~/docker-compose-letsencrypt-nginx-proxy-companion/
git status
Zrobiłeś merge i jest konflikt, chce zobaczyć czy tylko ten plik...
SOP 2023 :heavy_check_mark:
SOP 2024 :heavy_check_mark:
Czekam na kolejne Supla Offline Party :upside_down_face:
🧩: 🔑cz->b ⛴️+ila
groszek33
Posts: 73
Joined: Sun Feb 11, 2018 12:15 pm

Post

Oj sorki
On branch master
Your branch and 'origin/master' have diverged,
and have 139 and 3 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)

Unmerged paths:
(use "git add/rm <file>..." as appropriate to mark resolution)

deleted by us: docker-compose-multiple-networks.yml
both modified: docker-compose.yml
deleted by us: start.sh

Untracked files:
(use "git add <file>..." to include in what will be committed)

nginx-data/

no changes added to commit (use "git add" and/or "git commit -a")
Kto pyta nie błądzi:))
User avatar
lesny8
Posts: 3132
Joined: Mon Dec 11, 2017 9:43 pm
Has thanked: 10 times
Been thanked: 9 times

Post

Ok.
Trzeba rozwiązać konflikt w pliku, ale najszybciej będzie jak edytujesz sobie docker-compose.yml i wstawisz tam zawartość stąd .
Potem zrób

Code: Select all

git commit
SOP 2023 :heavy_check_mark:
SOP 2024 :heavy_check_mark:
Czekam na kolejne Supla Offline Party :upside_down_face:
🧩: 🔑cz->b ⛴️+ila
groszek33
Posts: 73
Joined: Sun Feb 11, 2018 12:15 pm

Post

U docker-compose-multiple-networks.yml
U docker-compose.yml
U start.sh
error: Committing is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
Przepraszam za ..
Ale...jak widać
Dzięki
Kto pyta nie błądzi:))
User avatar
lesny8
Posts: 3132
Joined: Mon Dec 11, 2017 9:43 pm
Has thanked: 10 times
Been thanked: 9 times

Post

Musisz rozwiązać konflikt po połączeniu. Normalnie robi się to uruchamiając

Code: Select all

git mergetool
ale nie wiem co tam za narzędzie Ci się uruchomi na malinie.
Bynajmniej usuwasz to co ma wylecieć, zostawiasz to co ma zostać. Pliki mają wyglądać tak jak u mnie na githubie.
Jak masz to zrobione to dodajesz wprowadzone zmiany (nie napisałem tego wcześniej) i zatwierdzasz

Code: Select all

git add .
git commit
Jak będziesz miał problem z tym to możesz też cały katalog usunąć lub zmienić mu nazwę i pobrać repo ode mnie z githuba, potem wystartować skrypt.

Code: Select all

cd ~
git clone https://github.com/lesny8/docker-compose-letsencrypt-nginx-proxy-companion.git
cd docker-compose-letsencrypt-nginx-proxy-companion
./start.sh
SOP 2023 :heavy_check_mark:
SOP 2024 :heavy_check_mark:
Czekam na kolejne Supla Offline Party :upside_down_face:
🧩: 🔑cz->b ⛴️+ila
groszek33
Posts: 73
Joined: Sun Feb 11, 2018 12:15 pm

Post

lesny8 jesteś wielki.
Dziękuję za wytrzymałość.
Wszystko ruszyło
Zmieniłem nazwę wgrałem i uzupełniłem plik.
Wszystko ruszyło.

Szacun dla Twojej wiedzy

Bardzo dziękuję
Kto pyta nie błądzi:))

Return to “FAQ / Jak to zrobić”