mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-01-30 18:39:50 +08:00
chore: start application in dev mode using docker (@fehmer) (#5647)
* chore: start application in dev mode using docker (@fehmer) * expose port env variable * regen lock * regen lock --------- Co-authored-by: Miodec <jack@monkeytype.com>
This commit is contained in:
parent
9889bfa546
commit
40514cd248
5 changed files with 21 additions and 10 deletions
|
@ -22,6 +22,7 @@ services:
|
|||
api-server:
|
||||
container_name: monkeytype-api-server
|
||||
image: node:18.20.4
|
||||
user: "node" ##this works as long as your local user has uid=1000
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- redis
|
||||
|
@ -32,11 +33,12 @@ services:
|
|||
ports:
|
||||
- "${DOCKER_SERVER_PORT:-5005}:5005"
|
||||
volumes:
|
||||
- be-modules:/monkeytype/backend/node_modules
|
||||
- ../../:/monkeytype
|
||||
entrypoint: 'bash -c "cd /monkeytype/backend && npm install && npm run dev"'
|
||||
entrypoint: 'bash -c "echo starting, this may take a while... \
|
||||
&& cd /monkeytype \
|
||||
&& npm i --prefer-offline --no-audit \
|
||||
&& npm run dev-be"'
|
||||
|
||||
volumes:
|
||||
mongo-data:
|
||||
redis-data:
|
||||
be-modules:
|
||||
|
|
|
@ -3,6 +3,7 @@ services:
|
|||
frontend:
|
||||
container_name: monkeytype-frontend
|
||||
image: node:18.20.4
|
||||
user: "node" ##this works as long as your local user has uid=1000
|
||||
# restart: on-failure
|
||||
environment:
|
||||
- SERVER_OPEN=false
|
||||
|
@ -10,13 +11,11 @@ services:
|
|||
ports:
|
||||
- "${DOCKER_HTTP_PORT:-3000}:3000"
|
||||
volumes:
|
||||
- root-modules:/monkeytype/node_modules
|
||||
- fe-modules:/monkeytype/frontend/node_modules
|
||||
- ../../:/monkeytype
|
||||
entrypoint: 'bash -c "cd /monkeytype && npm install && cd /monkeytype/frontend && npm install && npm run dev"'
|
||||
# entrypoint: "tail -f /dev/null"
|
||||
entrypoint: 'bash -c "echo starting, this may take a while... \
|
||||
&& cd /monkeytype \
|
||||
&& npm i --prefer-offline --no-audit \
|
||||
&& export SERVER_OPEN=false \
|
||||
&& npm run dev-fe"'
|
||||
|
||||
volumes:
|
||||
root-modules:
|
||||
fe-modules:
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
"@vitest/coverage-v8": "1.6.0",
|
||||
"ajv": "8.12.0",
|
||||
"autoprefixer": "10.4.14",
|
||||
"concurrently": "8.2.2",
|
||||
"dotenv": "16.4.5",
|
||||
"eslint": "8.57.0",
|
||||
"firebase-tools": "13.13.3",
|
||||
|
|
1
package-lock.json
generated
1
package-lock.json
generated
|
@ -177,6 +177,7 @@
|
|||
"@vitest/coverage-v8": "1.6.0",
|
||||
"ajv": "8.12.0",
|
||||
"autoprefixer": "10.4.14",
|
||||
"concurrently": "8.2.2",
|
||||
"dotenv": "16.4.5",
|
||||
"eslint": "8.57.0",
|
||||
"firebase-tools": "13.13.3",
|
||||
|
|
|
@ -29,6 +29,14 @@
|
|||
"@monkeytype/frontend#build": {
|
||||
"dependsOn": ["^build"],
|
||||
"env": ["BACKEND_URL", "RECAPTCHA_SITE_KEY"]
|
||||
},
|
||||
"@monkeytype/frontend#dev": {
|
||||
"dependsOn": ["^build"],
|
||||
"env": ["BACKEND_URL", "RECAPTCHA_SITE_KEY", "SERVER_OPEN"]
|
||||
},
|
||||
"@monkeytype/backend#dev": {
|
||||
"dependsOn": ["^build"],
|
||||
"env": ["DB_URI", "REDIS_URI", "PORT"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue