-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(node): Ensure docker file is generated when nest framework is sup…
…plied (#27153) When we generate a nest application and supply the `--docker` flag it should generate a DockerFile. <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> Currently, no DockerFile is created. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> A DockerFile to be created. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #17343
- Loading branch information
1 parent
2d2c0b5
commit bff23d1
Showing
3 changed files
with
55 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Node Applications should generate a nest application with docker 1`] = ` | ||
"# This file is generated by Nx. | ||
# | ||
# Build the docker image with \`npx nx docker-build node-nest-docker-test\`. | ||
# Tip: Modify "docker-build" options in project.json to change docker build args. | ||
# | ||
# Run the container with \`docker run -p 3000:3000 -t node-nest-docker-test\`. | ||
FROM docker.io/node:lts-alpine | ||
ENV HOST=0.0.0.0 | ||
ENV PORT=3000 | ||
WORKDIR /app | ||
RUN addgroup --system node-nest-docker-test && \\ | ||
adduser --system -G node-nest-docker-test node-nest-docker-test | ||
COPY dist/node-nest-docker-test node-nest-docker-test/ | ||
RUN chown -R node-nest-docker-test:node-nest-docker-test . | ||
# You can remove this install step if you build with \`--bundle\` option. | ||
# The bundled output will include external dependencies. | ||
RUN npm --prefix node-nest-docker-test --omit=dev -f install | ||
CMD [ "node", "node-nest-docker-test" ] | ||
" | ||
`; |
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