I am trying to setup Slack interactivity (handling the interactive elements click) on my backend. Of course, for this task I need to have a https:// endpoint, so ngRok is the best solution for this. I have previously worked with this tool and it is great, this is my old config for docker compose:
ngrok:
image: ngrok/ngrok:latest
restart: on-failure
env_file: ./.env.dev
command: tunnel --label edge=${NGROK_EDGE_GROUP} backend:8000
ports:
- 4040:4040
environment:
- NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN}
But now I have a new project and now I am running the Linux shell using the docker-compose, and inside the shell I am running the command npm run dev to start my server inside the shell. I have tried to start my docke-compose using this Dockerfile setup:
RUN apt-get update && apt-get install -y wget \
&& wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip \
&& unzip ngrok-stable-linux-amd64.zip \
&& mv ngrok /usr/local/bin/ngrok \
&& rm ngrok-stable-linux-amd64.zip
COPY .env.docker /app/.env.docker
EXPOSE 3001
EXPOSE 4040
ENV NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN}
ENV NGROK_EDGE_GROUP=${NGROK_EDGE_GROUP}
But unfortunately this attempt was a fail.
Also I have tried to run this command ngrok tunnel --label edge=${NGROK_EDGE_GROUP} 8000 inside the shell directly, but got the error like 'Unknown command "tunnel"'. Will be very appreciated for the solution!
RUN ngrok tunnel --label edge=${NGROK_EDGE_GROUP} http 8000 --authtoken=${NGROK_AUTHTOKEN}"]RUNbackground processes in a Dockerfile. In most cases it's better to run only one process in a container (you should not need to manually run commands inside containers). Can you run the ngrok tunnel in a separate container alongside your main application container?ngrok: image: ngrok/ngrok:latest restart: on-failure env_file: ./.env.docker command: tunnel --label edge=${NGROK_EDGE_GROUP} app:3001 ports: - 4040:4040 environment: - NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN} networks: - localAnd it doesn't work