[SOLVED] nginx in docker

  • I have working nextcloud/letsencrypt docker container thanks to excellent guide from @macom.
    Now I wish to install nginx/letsencrypt in docker for hosting simple website. Should I use nextcloud/letsencrypt stack or create another one? And most important, how to instal nginx/letsencrypt in docker? I'm using OMV 5 and portainer.
    Thanks.

    = Fujitsu PRIMERGY TX1310 M3 • 2 x HDD 3.5" 4TB Western Digital Red • Windows Server 2019 • Hyper-V • OMV 5.x =

  • That's actually really easy for you to do :)


    EDIT: OMV is running on port :80, so you should change that before running this container, or change the ports of the letsencrypt container like this:


    -p 7443:443
    -p 7780:80


    I just added a "7" or two. This means that you can catch your website on port :7780 for the http part. eg. 192.168.1.10:780 or mydomain.com:780


    I changed the OMV port myself, before doing this. I'm working on implementing a reverse proxy to take care of the ports automatically.


    Anyways...sorry about the confusion.


    Paste this into your portainer/stacks:


    Change it to your system, like PUID and PGID, TZ, URL, etc. If the validation is "http" you don't need the "DNSPLUGIN=" line 16.
    You can add all the domains you like, just add new lines, like "- EXTRA_DOMAINS=domain1.com #optional" and "- EXTRA_DOMAINS=domain2.com #optional"


    When you have changed all of your settings to your specific system, just push "deploy" and bingo, you have a running website on nginx with let's encrypt.


    SourceDH: https://hub.docker.com/r/linuxserver/letsencrypt
    SourceGH: https://github.com/linuxserver…ypt/blob/master/README.md

  • you have a running website on nginx with let's encrypt

    Thank you for answer. One question:

    ports:
    - 443:443
    - 80:80 #optional

    I think there will be a conflict with ports, my nextcloud/letsencrypt container uses 443 (and it's open in router) and OMV uses 80

    = Fujitsu PRIMERGY TX1310 M3 • 2 x HDD 3.5" 4TB Western Digital Red • Windows Server 2019 • Hyper-V • OMV 5.x =

  • Thank you for answer. One question:

    I think there will be a conflict with ports, my nextcloud/letsencrypt container uses 443 (and it's open in router) and OMV uses 80

    Sorry about the delay...yea, forgot that OMV is using port 80 as well. I changed my own to something else before running the deployment, some time ago :)


    I'm doing a lot of work these days, to implement Traefik Reverse Proxy on the Docker server. I want to use the latest Traefik v.2.1 , so it goes a little slow because of the recent changes.


    My guess is that eventually Traefik will become a part of Docker, to enable reverse proxy to its users. It's complicated to implement and hard to grasp, for the normal user, but it will get there eventually.


    We really need a stable logical reverse proxy to work with the Docker setup, as a native service configurable from an UI. Traefik is nice but changing rapidly.


    I hope that you will get everything running to your liking.

  • Thank you. I know that Nginx Reverse Proxy is working fine, and is easy to setup, but with Traefik you get autodiscovery of the containers you deploy, you just have to add the Traefik LABELS manually. In the perfect world, this should all happen automatically. It will get there I predict.


    Of course, if you only have a few sites it might be overkill with Traefik, but again, it's a nice challenge to get it working. On Github you'll find new Traefik composer files daily to set this up more "easily".


    Docker is amazing and makes life easy, compared to full-blown LAMP servers, etc.


    Lets see :)

  • Docker is amazing and makes life easy

    This is for sure. :) I struggled with LAMP/LEMP and always something get wrong. Now thanks to help from this great community and docker I have my basic needs covered> Nextcloud, media stuff etc.

    = Fujitsu PRIMERGY TX1310 M3 • 2 x HDD 3.5" 4TB Western Digital Red • Windows Server 2019 • Hyper-V • OMV 5.x =

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!