윤준석

ADD: ngrok ssl tunneling configuration and add to docker-compose

......@@ -5,5 +5,6 @@ docker build -t joongna-api-server ./joongna/
docker build -t bunjang-api-server ./bunjang/
docker build -t mamuri-db ./database/
docker build -t mamuri-server ./server/
docker build -t mamuri-ngrok ./ngrok/
docker-compose up -d
\ No newline at end of file
......
......@@ -38,4 +38,12 @@ services:
restart: always
container_name: bunjang-api-server
ports:
- '18082:8080'
\ No newline at end of file
- '18082:8080'
ngrok:
image: mamuri-ngrok
container_name: mamuri-ngrok
env_file:
- "ngrok/ngrok.yml"
ports:
- '4040:4040'
\ No newline at end of file
......
FROM ubuntu:latest as builder
WORKDIR /src
RUN apt-get update \
&& apt-get install -y wget
RUN wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz
RUN tar -xvzf ./ngrok-v3-stable-linux-amd64.tgz
FROM alpine
WORKDIR /src
COPY ngrok.yml /src
COPY start.sh /src
RUN chmod +x /src/start.sh
COPY --from=builder /src/ngrok /src/ngrok
RUN apk --no-cache add curl
RUN apk --no-cache add jq
EXPOSE 4040
CMD ["sh", "start.sh"]
\ No newline at end of file
authtoken: {YOUR_NGROK_AUTO_TOKEN}
version: 2
tunnels:
mamuri:
proto: http
addr: mamuri-server:8080
\ No newline at end of file
#!/bin/sh
echo "> Ngrok start in mamuri-server:8080"
/src/ngrok start --config=./ngrok.yml --all &
sleep 1s
public_url=$(curl -s localhost:4040/api/tunnels | jq -r .tunnels[0].public_url)
echo "> public_url: $public_url"
tail -f /dev/null
\ No newline at end of file
......@@ -7,3 +7,4 @@ docker image rm joongna-api-server
docker image rm bunjang-api-server
docker image rm mamuri-db
docker image rm mamuri-server
docker image rm mamuri-ngrok
\ No newline at end of file
......