Skip to content

Commit

Permalink
Setup hot reloading for dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Eroxl committed Jan 21, 2023
1 parent 2414261 commit 7987683
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 2 deletions.
62 changes: 62 additions & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
version: '3.8'

services:
mongo:
image: mongo:4.0-xenial
restart: unless-stopped
ports:
- 27017:27017
volumes:
- mongo-data:/data/db
logging:
driver: none

supertokens:
image: registry.supertokens.io/supertokens/supertokens-mysql:4.2
depends_on:
- sql
ports:
- 3567:3567
environment:
MYSQL_CONNECTION_URI: mysql://supertokens_user:somePassword@sql:3306/supertokens
networks:
- supertokens-sql
restart:
unless-stopped
healthcheck:
test: >
bash -c 'exec 3<>/dev/tcp/127.0.0.1/3567 && echo -e "GET /hello HTTP/1.1\r\nhost: 127.0.0.1:3567\r\nConnection: close\r\n\r\n" >&3 && cat <&3 | grep "Hello"'
interval: 10s
timeout: 5s
retries: 5
logging:
driver: none

sql:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: supertokens_user
MYSQL_PASSWORD: somePassword
MYSQL_DATABASE: supertokens
expose:
- 3306
networks:
- supertokens-sql
volumes:
- sql-data:/var/lib/mysql
restart:
unless-stopped
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
timeout: 20s
retries: 10
logging:
driver: none

volumes:
mongo-data:
sql-data:

networks:
supertokens-sql:
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
{
"name": "note-rack",
"version": "1.0.0",
"description": "<h1 align=\"center\"> 📝 Note Rack </h1>",
"description": "Note Rack",
"main": "index.js",
"devDependencies": {
"cypress": "^11.2.0"
},
"scripts": {
"test": "docker-compose down -v && docker-compose build && docker-compose up -d && cypress run --browser chrome",
"test:manual": "docker-compose down -v && docker-compose build && docker-compose up -d && cypress open"
"test:manual": "docker-compose down -v && docker-compose build && docker-compose up -d && cypress open",

"dev": "docker-compose -f docker-compose.dev.yaml build && docker-compose -f docker-compose.dev.yaml up",
"dev:down": "docker-compose -f docker-compose.dev.yaml down",

"build": "docker-compose build",
"start": "yarn build && docker-compose up",
"start:down": "docker-compose down"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 7987683

Please sign in to comment.