Somik's Home

Server admins cheat codes

Use the following docker compose file to host a Nginx reverse proxy on your docker container to use 1 IP to host multiple websites, all with HTTPS.

version: "3"

volumes:
  proxy_data:
    name: proxy_data
  letsencrypt:
    name: proxy_certs
  mysqldb:
    name: proxy_mysql

services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      # These ports are in format <host-port>:<container-port>
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
      # Add any other Stream port you want to expose
      # - '21:21' # FTP
    environment:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "MySuper$ecretPassword"
      DB_MYSQL_NAME: "npm"
      DISABLE_IPV6: 'true'
    volumes:
      - proxy_data:/data
      - letsencrypt:/etc/letsencrypt
    depends_on:
      - db

  db:
    image: 'jc21/mariadb-aria:latest'
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: 'MySQL$uper$ecr3tROOTPassword'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'MySuper$ecretPassword'
    volumes:
      - mysqldb:/var/lib/mysql

First login username and password:

Email:     admin@example.com
Password:  changeme

© Beli. All Rights Reserved.