ADD: ngrok ssl tunneling configuration and add to docker-compose
Showing
6 changed files
with
53 additions
and
0 deletions
... | @@ -5,5 +5,6 @@ docker build -t joongna-api-server ./joongna/ | ... | @@ -5,5 +5,6 @@ docker build -t joongna-api-server ./joongna/ |
5 | docker build -t bunjang-api-server ./bunjang/ | 5 | docker build -t bunjang-api-server ./bunjang/ |
6 | docker build -t mamuri-db ./database/ | 6 | docker build -t mamuri-db ./database/ |
7 | docker build -t mamuri-server ./server/ | 7 | docker build -t mamuri-server ./server/ |
8 | +docker build -t mamuri-ngrok ./ngrok/ | ||
8 | 9 | ||
9 | docker-compose up -d | 10 | docker-compose up -d |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -39,3 +39,11 @@ services: | ... | @@ -39,3 +39,11 @@ services: |
39 | container_name: bunjang-api-server | 39 | container_name: bunjang-api-server |
40 | ports: | 40 | ports: |
41 | - '18082:8080' | 41 | - '18082:8080' |
42 | + | ||
43 | + ngrok: | ||
44 | + image: mamuri-ngrok | ||
45 | + container_name: mamuri-ngrok | ||
46 | + env_file: | ||
47 | + - "ngrok/ngrok.yml" | ||
48 | + ports: | ||
49 | + - '4040:4040' | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
ngrok/Dockerfile
0 → 100644
1 | +FROM ubuntu:latest as builder | ||
2 | + | ||
3 | +WORKDIR /src | ||
4 | + | ||
5 | +RUN apt-get update \ | ||
6 | + && apt-get install -y wget | ||
7 | + | ||
8 | +RUN wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz | ||
9 | +RUN tar -xvzf ./ngrok-v3-stable-linux-amd64.tgz | ||
10 | + | ||
11 | +FROM alpine | ||
12 | + | ||
13 | +WORKDIR /src | ||
14 | + | ||
15 | +COPY ngrok.yml /src | ||
16 | +COPY start.sh /src | ||
17 | +RUN chmod +x /src/start.sh | ||
18 | + | ||
19 | +COPY --from=builder /src/ngrok /src/ngrok | ||
20 | + | ||
21 | +RUN apk --no-cache add curl | ||
22 | +RUN apk --no-cache add jq | ||
23 | + | ||
24 | +EXPOSE 4040 | ||
25 | + | ||
26 | +CMD ["sh", "start.sh"] | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
ngrok/ngrok.yml_example
0 → 100644
ngrok/start.sh
0 → 100644
1 | +#!/bin/sh | ||
2 | + | ||
3 | +echo "> Ngrok start in mamuri-server:8080" | ||
4 | +/src/ngrok start --config=./ngrok.yml --all & | ||
5 | + | ||
6 | +sleep 1s | ||
7 | + | ||
8 | +public_url=$(curl -s localhost:4040/api/tunnels | jq -r .tunnels[0].public_url) | ||
9 | +echo "> public_url: $public_url" | ||
10 | + | ||
11 | +tail -f /dev/null | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -7,3 +7,4 @@ docker image rm joongna-api-server | ... | @@ -7,3 +7,4 @@ docker image rm joongna-api-server |
7 | docker image rm bunjang-api-server | 7 | docker image rm bunjang-api-server |
8 | docker image rm mamuri-db | 8 | docker image rm mamuri-db |
9 | docker image rm mamuri-server | 9 | docker image rm mamuri-server |
10 | +docker image rm mamuri-ngrok | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment