8000 GitHub - baikov/dev-sop-tr
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

baikov/dev-sop-tr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reverse proxy for Orders project

Other parts:

  1. Revers-proxy
  2. Front
  3. Back

Global reverse-proxy for local development

Creates an external network dev-proxy to which frontend and backend containers are connected.

Preparation

  1. Install Docker Desktop
  2. Copy .env.example and rename it to .env

Mode 1: local development without https

  1. Set project name (the same for Traefik repo, Nuxt repo and Django repo if use all stack)
    COMPOSE_PROJECT_NAME=orders
  2. Uncomment Mode 1 block:
    # 1. As reverse-proxy for development on localhost with http
    COMPOSE_FILE=local.yml
    DOMAIN=localhost  # or another aliace for 127.0.0.1 declared in etc/hosts
  3. Run docker compose build and docker compose up -d

Traefik dashboard is available at: http://localhost:8080/dashboard/#/

Mode 2: local development with custom domain and https

  1. Set project name (the same for Traefik repo, Nuxt repo and Django repo if use all stack)
    COMPOSE_PROJECT_NAME=orders
  2. Uncomment Mode 2 block:
    # Mode 2: SSL-mode (with custom domain)
    COMPOSE_FILE=local.ssl.yml
    DOMAIN=orders.local
  3. Add local domain + subdomain for dashboard in /etc/hosts:
    127.0.0.1 localhost orders.local tr.orders.local
  4. Apply changes:
    sudo killall -HUP mDNSResponder
  5. Install mkcert (or another tolls for local certificates)
  6. Go to ./compose/local-ssl/cert/
  7. Generate a wildcard certificate for a local domain:
    mkcert -cert-file orders.local.pem -key-file orders.local-key.pem orders.local "*.orders.local"  # * for subdomains
  8. Install local CA certificate with the command:
    mkcert -install
  9. If you use not orders.local - go to ./compose/local-ssl/dynamic/ and edit tls.yml. Change the file names to your own
  10. Run docker compose build and docker compose up -d

Traefik dashboard is available at: https://tr.orders.local/dashboard/#/

Production reverse-proxy in Docker (Mode 3)

Creates an external network global to which frontend and backend containers are connected.

  1. Copy .env.example and rename it to .env on production server
  2. Set project name (the same for Traefik repo, Nuxt repo and Django repo if use all stack)
    COMPOSE_PROJECT_NAME=orders
  3. Uncomment Mode 3 block and change domain and email:
    # Mode 3: As reverse-proxy for production
    COMPOSE_FILE=production.yml
    DOMAIN=orders.baikov.dev
    EMAIL=emailfor@letsencrypt.com  # for Let's Encrypt resolver
  4. Run docker compose build and docker compose up -d
  5. If the domain is correctly bound to the server, the certificate will be issued automatically with Let's Encrypt

Traefik dashboard is available at: https://tr.baikov.dev/dashboard/#/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0