Giter Site home page Giter Site logo

Comments (7)

JonasAlfredsson avatar JonasAlfredsson commented on May 26, 2024

Hi captain828,

I am not sure how you start the image, but for me it sure looks like the entrypoint scirpt executes?

docker run -it -e CERTBOT_EMAIL=test -e USE_LOCAL_CA=1 -e DEBUG=1 jonasal/nginx-certbot:latest

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2023/12/21 10:37:40 [debug] Debug messages are enabled

from docker-nginx-certbot.

captain828 avatar captain828 commented on May 26, 2024

I am using docker-compose and passing an environment file for the entire compose script (extra services removed for brevity).

services:
  nginx:
      image: jonasal/nginx-certbot:latest-alpine
      restart: unless-stopped
      environment:
        - CERTBOT_EMAIL=${CERTBOT_EMAIL}
        - APP_DOMAIN=${APP_DOMAIN}
        - APP_HOST=${APP_HOST}
      ports:
        - 80:80
        - 443:443
      volumes:
        - ./nginx/app.conf:/etc/nginx/templates/app.conf
        - ./nginx/envar_substitution.sh:/docker-entrypoint.d/envar_substitution.sh
        - ./nginx/static:/var/www/app/static
      command: >
        sh -cx "chmod +x /docker-entrypoint.d/envar_substitution.sh &&
                /scripts/start_nginx_certbot.sh"

volumes:
  nginx:
    driver: local

Where envar_substitution.sh is:

#!/bin/sh

export APP_DOMAIN
export APP_HOST

envsubst '${APP_DOMAIN},${APP_HOST}' < /etc/nginx/templates/app.conf > /etc/nginx/user_conf.d/app.conf

exec "$@"

from docker-nginx-certbot.

JonasAlfredsson avatar JonasAlfredsson commented on May 26, 2024

Can you add DEBUG=1 to your environment and remove the "command" section outright and paste the logs here.

from docker-nginx-certbot.

JonasAlfredsson avatar JonasAlfredsson commented on May 26, 2024

You could probably also do a docker inspect on the current container to see which entrypoint it uses.

from docker-nginx-certbot.

captain828 avatar captain828 commented on May 26, 2024

Hhm, you're right, it is still using the original entrypoint according to inspect.

Removing the "command" section does lead to docker-entrypoint.sh being correctly executed again.

It's as if the command section is overwriting the entrypoint.

from docker-nginx-certbot.

captain828 avatar captain828 commented on May 26, 2024

So it's my bad in the end as docker-compose will overwrite the standard entrypoint if a command is set.

from docker-nginx-certbot.

JonasAlfredsson avatar JonasAlfredsson commented on May 26, 2024

Glad it seems to work now!

from docker-nginx-certbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.