@@ 14,6 14,14 @@ apk add nginx
rc-update add nginx
rc-service nginx start
+if [ "$ENVIRONMENT" = 'production' ]; then
+ # Certbot
+ echo "Installing Let's Encrypt certificate"
+ apk add certbot-nginx
+ certbot certonly --nginx --agree-tos -m "$ADMIN_EMAIL" --no-eff-email \
+ -d "$DECIDIM_DOMAIN"
+fi
+
echo "Setting up $DECIDIM_DOMAIN on Nginx"
cat << EOF > "/etc/nginx/http.d/$DECIDIM_DOMAIN.conf"
server {
@@ 38,11 46,6 @@ EOF
if [ "$ENVIRONMENT" = 'production' ]; then
# Certbot
- echo "Installing Let's Encrypt certificate"
- apk add certbot-nginx
- certbot certonly --nginx --agree-tos -m "$ADMIN_EMAIL" --no-eff-email \
- -d "$DECIDIM_DOMAIN"
-
cat << EOF >> "/etc/nginx/http.d/$DECIDIM_DOMAIN.conf"
ssl_certificate /etc/letsencrypt/live/$DECIDIM_DOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$DECIDIM_DOMAIN/privkey.pem;