Skip to content

Commit

Permalink
Integrated Ngrok
Browse files Browse the repository at this point in the history
Adjusted docker-compose.yml to run ngrok using my personal authentication token
  • Loading branch information
aayushh-patell committed May 28, 2024
1 parent 44fd7be commit e577bd9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
Binary file modified .DS_Store
Binary file not shown.
10 changes: 8 additions & 2 deletions backend/typescript/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ COPY package.json yarn.lock tsconfig.json ./

RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list

# libcurl3 is required for mongodb-memory-server, which is used for testing
RUN apt-get update && apt-get install -y libcurl3
# Install dependencies
RUN apt-get update && apt-get install -y libcurl4 curl unzip

# Install ngrok using curl
RUN curl -o ngrok-stable-linux-amd64.zip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip && \
unzip ngrok-stable-linux-amd64.zip && \
mv ngrok /usr/local/bin/ && \
rm ngrok-stable-linux-amd64.zip

RUN yarn install

Expand Down
21 changes: 17 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ services:
- ./frontend:/app
- /app/node_modules
ports:
- 3000:3000
- "3000:3000"
environment:
- CHOKIDAR_USEPOLLING=true
env_file:
- ./frontend/.env

ts-backend:
container_name: de_ts_backend
build:
Expand All @@ -24,7 +25,7 @@ services:
- ./backend/typescript:/app
- /app/node_modules
ports:
- 5000:5000
- "5001:5001"
dns:
- 8.8.8.8
depends_on:
Expand All @@ -33,11 +34,12 @@ services:
env_file:
- ./.env
- ./backend/typescript/.env

db:
container_name: de_db
image: postgres:12-alpine
ports:
- 5432:5432
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data/
- ./db-init:/docker-entrypoint-initdb.d
Expand All @@ -46,10 +48,21 @@ services:
environment:
- POSTGRES_MULTIPLE_DATABASES=${POSTGRES_DB_DEV},${POSTGRES_DB_TEST}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5

ngrok:
image: ngrok/ngrok:latest
platform: linux/arm64
command: ngrok http ts-backend:5001
ports:
- "4040:4040" # ngrok web interface
depends_on:
- ts-backend
environment:
- NGROK_AUTHTOKEN=2gqfbeXPRkhFsAGXsIpFZJCiitr_7VbDSwxB2h9Z6HbeK259K

volumes:
postgres_data:

0 comments on commit e577bd9

Please sign in to comment.