Score:0

How to use https on docker-compose project Vue, express

mx flag

I am trying to enable HTTPS connection for my project. Currently, I can go to http://domainname.com:8080 and everything works, but I need to have HTTPS connection.

I am sending my docker-compose.yml file without API and DB:

version: "3"
volumes:
 dhparam: # not sure what for ;)
 vhostd: # configuration of hosts, written by nginx-gen, used by nginx-proxy
 html: # contains .well-known directory, written by letsencrypt, served by nginx-proxy

services:

  # letsencrypt pomocny kontajner
  nginx-proxy-companion:
    image: "jrcs/letsencrypt-nginx-proxy-companion:${NGINXPROXYLETSENCRYPTCOMPANION_TAG}"
    restart: unless-stopped
    volumes:
    - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
    - vhostd:/etc/nginx/vhost.d
    - html:/usr/share/nginx/html
    - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs
    - ${DOCKER_SOCK:-/var/run/docker.sock}:/var/run/docker.sock:ro
    depends_on:
    - nginx-proxy
    environment:
    - "DEFAULT_EMAIL=${ADMIN_EMAIL}"
    - "NGINX_DOCKER_GEN_CONTAINER=${DOCKER_GEN:-nginx-gen}"
    - "NGINX_PROXY_CONTAINER=${NGINX_WEB:-nginx-web}"
    logging:
      driver: "json-file"
      options:
        max-size: "200k"
        max-file: "10"

  # generator konfigu pre vstupne reverzne proxy
  nginx-gen:
    image: "jwilder/docker-gen:${NGINXPROXY_DOCKERGEN_TAG}"
    labels:
      com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: true
    command: -notify-sighup ${COMPOSE_PROJECT_NAME}_nginx-proxy_1 -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
    restart: unless-stopped
    volumes:
    - ${DOCKER_SOCK:-/var/run/docker.sock}:/tmp/docker.sock:ro
    - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
    - vhostd:/etc/nginx/vhost.d
    - html:/usr/share/nginx/html
    - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro
    - ${NGINX_FILES_PATH:-./data}/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
    environment:
    - SSL_POLICY
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "10"

  # reverse proxy
  nginx-proxy:
    image: "nginx:${NGINX_TAG:-latest}"
    restart: unless-stopped
    ports:
    - "0.0.0.0:8080:80"
    - "0.0.0.0:443:443"
    depends_on:
    - nginx-gen
    volumes:
    - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d:ro
    - vhostd:/etc/nginx/vhost.d:ro
    - html:/usr/share/nginx/html:ro
    - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro
    - ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro
    links:
    - bozp-gui
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "10"

  # GUI kontajner (cez vstupne reverzne proxy)
  bozp-gui:
    build: ./bozp-gui
    image: bozp-gui:latest
    restart: unless-stopped
    links:
    - bozp-api
    depends_on:
    - bozp-api
    environment:
    - "LETSENCRYPT_HOST=${VIRTUAL_HOST}"
    - "VIRTUAL_HOST=${VIRTUAL_HOST}"
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "10"

In Dockerfile for Vue.js app I am exposing ports 80 and 443.

Thanks.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.