Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running as https, under nginx or custom domain #43

Closed
AlessioGr opened this issue May 30, 2022 · 4 comments
Closed

Running as https, under nginx or custom domain #43

AlessioGr opened this issue May 30, 2022 · 4 comments

Comments

@AlessioGr
Copy link

Hey,

how can I run this with https enabled, either via nginx or a custom domain? I found no information regarding this in the readme.

Do I need to change the Dockerfile to use the nginx alpine image? And what would I do next?

@VincentSC
Copy link

VincentSC commented Jun 23, 2022

Via nginx-proxy.

Here's the docker-compose:

version: "3"

services:
  languagetool:
    image: erikvl87/languagetool
    container_name: languagetool
#    ports:
#      - 8010:8010
    environment:
      - VIRTUAL_HOST=${DOMAIN}
      - VIRTUAL_PORT=8010
      - LETSENCRYPT_HOST=${DOMAIN}
      - langtool_languageModel=/ngrams
      - Java_Xms=512m
      - Java_Xmx=1g
    volumes:
      - ./volumes/ngrams:/ngrams
    networks:
      - nginx-proxy

networks:
  nginx-proxy:
    external:
      name: nginx-proxy

Set the domain in .env. Be sure to have nginx-proxy set up correctly, including the nginx-proxy network

@leerobert
Copy link

@VincentSC any chance you could be a little more specific with the full docker-compose.yml including the nginx-proxy configuration? Or maybe some kind of step by step?

Did you not use https://github.com/nginx-proxy/acme-companion to get SSL support?

@Erikvl87
Copy link
Owner

Closed due to inactivity.

@VincentSC
Copy link

@leerobert Totally missed this.

Correct. I've been using nginx for over a decade, hence my preference. There are multiple solutions (using Nginx, Apache, Lighttpd), but they all work the same:

  • the public facing docker is connected to an external network
  • a reverse proxy detects a new docker on the network via the variables, and self-configures the internal IP to the given domain name. Some reverse proxies require the config to be centralized, though.
  • let's encrypt kicks in. Regularly it's updated.

In .env I set DOMAIN=lt.domain.com - I tend to make generic dockers, so I can more easily test without editing docker-compose.yml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants