-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wallet/backend,boutique/backend): DEV env - add hot reload for w…
…allet and boutique backends (#1740) * setup wallet backend hot reload * setup wallet backend hot reload dockerfile.dev * setup boutique backend hot reload * wallet hot reload watch also for shared folder changes * fix watch share path and remove chokidar env var * enable multiple types of local environment run configurations * pretty fix * fix pnpm lock
- Loading branch information
1 parent
36a6c42
commit 0bd0d75
Showing
10 changed files
with
159 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
if [ "$DEV_MODE" = "lite" ]; then | ||
echo "DEV_MODE is lite, running default command..." | ||
exec node ./packages/boutique/backend/dist/index.js | ||
elif [ "$DEV_MODE" = "debug" ]; then | ||
echo "DEV_MODE is debug, running build with debug port $DEBUG_PORT open..." | ||
exec node --inspect=0.0.0.0:${DEBUG_PORT} ./packages/boutique/backend/dist/index.js | ||
else | ||
echo "DEV_MODE is hot-reload, running dev command with nodemon watcher and rebuild..." | ||
exec pnpm boutique:backend dev | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ RUN corepack enable | |
RUN corepack prepare [email protected] --activate | ||
|
||
# Copy lockfile, NVM and NPM configuration to the working directory | ||
COPY pnpm-lock.yaml .nvmrc .npmrc ./ | ||
COPY pnpm-lock.yaml .nvmrc .npmrc boutique-entrypoint.sh ./ | ||
|
||
# Fetch packages from lockfile (https://pnpm.io/cli/fetch#usage-scenario) | ||
RUN pnpm fetch | ||
|
@@ -23,7 +23,16 @@ ADD . ./ | |
# Install packages from virtual store | ||
RUN pnpm install -r --offline | ||
|
||
# Build backend | ||
RUN pnpm boutique:backend build | ||
|
||
CMD ["node", "./packages/boutique/backend/dist/index.js"] | ||
# Expose debugger port regardlless of DEV_MODE | ||
EXPOSE ${DEBUG_PORT} | ||
|
||
ARG DEV_MODE | ||
|
||
# Set it as an environment variable | ||
ENV DEV_MODE=${DEV_MODE} | ||
|
||
RUN chmod +x /home/testnet/boutique-entrypoint.sh | ||
|
||
ENTRYPOINT ["/home/testnet/boutique-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ RUN corepack enable | |
RUN corepack prepare [email protected] --activate | ||
|
||
# Copy lockfile, NVM and NPM configuration to the working directory | ||
COPY pnpm-lock.yaml .nvmrc .npmrc ./ | ||
COPY pnpm-lock.yaml .nvmrc .npmrc wallet-entrypoint.sh ./ | ||
|
||
# Fetch packages from lockfile (https://pnpm.io/cli/fetch#usage-scenario) | ||
RUN pnpm fetch | ||
|
@@ -27,6 +27,13 @@ RUN pnpm install -r --offline | |
RUN pnpm wallet:backend build | ||
|
||
# Expose debugger port | ||
EXPOSE 9229 | ||
EXPOSE ${DEBUG_PORT} | ||
|
||
CMD ["node", "--inspect=0.0.0.0:9229", "./packages/wallet/backend/dist/index.js"] | ||
ARG DEV_MODE | ||
|
||
# Set it as an environment variable | ||
ENV DEV_MODE=${DEV_MODE} | ||
|
||
RUN chmod +x /home/testnet/wallet-entrypoint.sh | ||
|
||
ENTRYPOINT ["/home/testnet/wallet-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.