diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml new file mode 100644 index 00000000..39e2db22 --- /dev/null +++ b/docker-compose.dev.yaml @@ -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: diff --git a/package.json b/package.json index 832941df..9f3fc342 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,21 @@ { "name": "note-rack", "version": "1.0.0", - "description": "

📝 Note Rack

", + "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",