mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Merge remote changes and resolve conflicts
This commit is contained in:
@@ -18,6 +18,8 @@ services:
|
||||
- webroot:/var/www/html
|
||||
depends_on:
|
||||
- backend
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
backend:
|
||||
build:
|
||||
@@ -31,11 +33,11 @@ services:
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
- sqlite_data:/app/instance
|
||||
ports:
|
||||
- "8000:8000"
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
certbot:
|
||||
image: certbot/certbot
|
||||
image: certbot/certbot:latest
|
||||
container_name: certbot
|
||||
volumes:
|
||||
- certbot-etc:/etc/letsencrypt
|
||||
@@ -43,7 +45,13 @@ services:
|
||||
- webroot:/var/www/html
|
||||
depends_on:
|
||||
- frontend
|
||||
command: certonly --webroot --webroot-path=/var/www/html --email admin@itformhelp.ru --agree-tos --no-eff-email --force-renewal --staging -d itformhelp.ru -d www.itformhelp.ru
|
||||
networks:
|
||||
- app-network
|
||||
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
sqlite_data:
|
||||
|
34
init-letsencrypt.sh
Normal file
34
init-letsencrypt.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
domains=(itformhelp.ru www.itformhelp.ru)
|
||||
email="admin@itformhelp.ru"
|
||||
staging=0 # Set to 1 if you're testing your setup
|
||||
|
||||
# Create dummy certificates
|
||||
path="/etc/letsencrypt/live/$domains"
|
||||
docker compose run --rm --entrypoint "\
|
||||
openssl req -x509 -nodes -newkey rsa:4096 -days 1\
|
||||
-keyout '$path/privkey.pem' \
|
||||
-out '$path/fullchain.pem' \
|
||||
-subj '/CN=localhost'" certbot
|
||||
|
||||
echo "### Starting nginx ..."
|
||||
docker compose up --force-recreate -d frontend
|
||||
|
||||
echo "### Deleting dummy certificate ..."
|
||||
docker compose run --rm --entrypoint "\
|
||||
rm -Rf /etc/letsencrypt/live/$domains && \
|
||||
rm -Rf /etc/letsencrypt/archive/$domains && \
|
||||
rm -Rf /etc/letsencrypt/renewal/$domains.conf" certbot
|
||||
|
||||
echo "### Requesting Let's Encrypt certificate ..."
|
||||
docker compose run --rm --entrypoint "\
|
||||
certbot certonly --webroot -w /var/www/html \
|
||||
--email $email \
|
||||
--agree-tos \
|
||||
--no-eff-email \
|
||||
--force-renewal \
|
||||
${staging:+--staging}" certbot
|
||||
|
||||
echo "### Reloading nginx ..."
|
||||
docker compose exec frontend nginx -s reload
|
Reference in New Issue
Block a user