LoginSignup
0
1

Ngrokのdomainを固定してDockerで立ち上げる方法

Posted at

メニューのDomainsに移動します

image.png (21.8 kB)

New Domainをクリックします
無料プランでは1つしか作れないです

image.png (89.8 kB)

Domainを1つもらいました。
스크린샷 2024-02-28 오후 7.02.15.png

docker-compose.ymlのservicesにngrok container追加

docker-compose.yml
    ngrok:
        image: ngrok/ngrok:latest
        ports:
            - 4040:4040
        volumes:
            - ./ngrok.yml:/etc/ngrok.yml
        environment:
            NGROK_AUTHTOKEN: ${NGROK_AUTH_TOKEN}
            NGROK_CONFIG: /etc/ngrok.yml

docker-compose.ymlと同じディレクトリにngrok.ymlを作ります

ngrok.yml
tunnels:
  website:
    addr: web
    basic_auth:
      - "user:password"
    schemes:
      - https
    host_header: "domain"
    inspect: false
    proto: http
    domain: domain
version: 2

DockerのBuildをし直す

docker compose build

終わりです〜!

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1