-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: hot server reload & debugging over docker #2718
Changes from 14 commits
649ff1d
e2c6a29
1fba772
e59e8b5
9336e1b
6389803
01d2d09
10e8019
263e3ce
ae28599
27e0fff
9c58f51
02a5e6b
b9c415c
07d81a1
66663a9
2de0f80
38ad16e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,13 +32,19 @@ services: | |
image: rafiki-backend | ||
build: | ||
context: ../.. | ||
dockerfile: ./packages/backend/Dockerfile | ||
dockerfile: ./packages/backend/Dockerfile.dev | ||
volumes: | ||
- type: bind | ||
source: ../../packages/backend/src | ||
target: /home/rafiki/packages/backend/src | ||
read_only: true | ||
restart: always | ||
privileged: true | ||
ports: | ||
- '3000:80' | ||
- '3001:3001' | ||
- '3002:3002' | ||
- "9229:9229" | ||
networks: | ||
- rafiki | ||
environment: | ||
|
@@ -73,13 +79,19 @@ services: | |
image: rafiki-auth | ||
build: | ||
context: ../.. | ||
dockerfile: ./packages/auth/Dockerfile | ||
dockerfile: ./packages/auth/Dockerfile.dev | ||
volumes: | ||
- type: bind | ||
source: ../../packages/auth/src | ||
target: /home/rafiki/packages/auth/src | ||
read_only: true | ||
restart: always | ||
networks: | ||
- rafiki | ||
ports: | ||
- '3003:3003' | ||
- '3006:3006' | ||
- "9230:9229" | ||
environment: | ||
NODE_ENV: ${NODE_ENV:-development} | ||
TRUST_PROXY: ${TRUST_PROXY} | ||
|
@@ -112,7 +124,7 @@ services: | |
image: rafiki-frontend | ||
build: | ||
context: ../.. | ||
dockerfile: ./packages/frontend/devDockerfile | ||
dockerfile: ./packages/frontend/Dockerfile.dev | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. went ahead and renamed this for consistency. I went with |
||
volumes: | ||
- type: bind | ||
source: ../../packages/frontend/app | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM node:20-alpine3.18 | ||
|
||
WORKDIR /home/rafiki | ||
|
||
RUN corepack enable | ||
RUN corepack prepare [email protected] --activate | ||
|
||
COPY pnpm-lock.yaml package.json pnpm-workspace.yaml .npmrc tsconfig.json tsconfig.build.json ./ | ||
|
||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ | ||
pnpm fetch \ | ||
| grep -v "cross-device link not permitted\|Falling back to copying packages from store" | ||
|
||
COPY . ./ | ||
|
||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ | ||
pnpm install \ | ||
--recursive \ | ||
--offline \ | ||
--frozen-lockfile | ||
|
||
RUN pnpm --filter auth build:deps | ||
|
||
CMD pnpm --filter auth dev |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -18,7 +18,8 @@ | |||
"prepack": "pnpm build", | ||||
"postinstall": "pnpm copy-op-schemas", | ||||
"copy-op-schemas": "cp ./node_modules/@interledger/open-payments/dist/openapi/specs/auth-server.yaml ./node_modules/@interledger/open-payments/dist/openapi/specs/schemas.yaml ./src/openapi/specs/", | ||||
"copy-files": "cp src/graphql/schema.graphql dist/graphql/ && cp -r ./src/openapi ./dist/" | ||||
"copy-files": "cp src/graphql/schema.graphql dist/graphql/ && cp -r ./src/openapi ./dist/", | ||||
"dev": "ts-node-dev --inspect=0.0.0.0:9229 --respawn --transpile-only src/index.ts" | ||||
}, | ||||
"dependencies": { | ||||
"@adonisjs/fold": "^8.2.0", | ||||
|
@@ -47,6 +48,7 @@ | |||
"pg": "^8.11.3", | ||||
"pino": "^8.19.0", | ||||
"token-introspection": "workspace:*", | ||||
"ts-node-dev": "^2.0.0", | ||||
"uuid": "^9.0.1" | ||||
}, | ||||
"devDependencies": { | ||||
|
@@ -66,6 +68,7 @@ | |||
"jest-openapi": "^0.14.2", | ||||
"nock": "^13.5.4", | ||||
"node-mocks-http": "^1.14.1", | ||||
"nodemon": "^3.1.0", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch, committed locally and updated the lockfile |
||||
"openapi-types": "^12.1.3", | ||||
"pino-pretty": "^11.0.0", | ||||
"testcontainers": "^10.7.2" | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM node:20-alpine3.18 | ||
|
||
WORKDIR /home/rafiki | ||
|
||
RUN corepack enable | ||
RUN corepack prepare [email protected] --activate | ||
|
||
COPY pnpm-lock.yaml package.json pnpm-workspace.yaml .npmrc tsconfig.json tsconfig.build.json ./ | ||
|
||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ | ||
pnpm fetch \ | ||
| grep -v "cross-device link not permitted\|Falling back to copying packages from store" | ||
|
||
COPY . ./ | ||
|
||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ | ||
pnpm install \ | ||
--recursive \ | ||
--offline \ | ||
--frozen-lockfile | ||
|
||
RUN pnpm --filter backend build:deps | ||
|
||
CMD pnpm --filter backend dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add a section with the launch.json configuration for VSCode as well?
Also, did you want to keep it just in this readme, or should we also add it to the documentation site?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added the vscode section and added to the documentation site: 02a5e6b