Skip to content

Commit

Permalink
feat(node-env): set NODE_ENV as production
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Aug 9, 2024
1 parent e1cddd2 commit 0c51468
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/scaffolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export default async function ({projectRoot, buildDirectory}) {
await fs.writeFile(`${projectRoot}/Dockerfile`, `ARG NODE_VERSION
FROM node:\${NODE_VERSION}-alpine
ENV NODE_ENV="production"
USER node
COPY ${buildDirectory}/index.js
Expand Down
2 changes: 2 additions & 0 deletions src/scaffolder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ describe('scaffolder', () => {
expect(fs.writeFile).toHaveBeenCalledWith(`${projectRoot}/Dockerfile`, `ARG NODE_VERSION
FROM node:\${NODE_VERSION}-alpine
ENV NODE_ENV="production"
USER node
COPY ${buildDirectory}/index.js
Expand Down

0 comments on commit 0c51468

Please sign in to comment.