Skip to content

Commit

Permalink
Apply esbuild in docker (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize authored Feb 5, 2024
2 parents d455546 + 20297e9 commit 7b62619
Show file tree
Hide file tree
Showing 8 changed files with 260 additions and 15 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ name: Create and publish a Docker image
# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
push:
# branches: ['release']
branches:
- main
- canary
pull_request:
branches:
- canary

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ENV NPM_VERSION 10.2.5-r0
# Make sure `"type": "module"` is set in package.json
COPY --from=build /app/package.json /app/package.json
# Production dependencies
COPY --from=build /app/node_modules /app/node_modules
# COPY --from=build /app/node_modules /app/node_modules
# Application
COPY --from=build /app/dist /app

Expand Down Expand Up @@ -73,4 +73,4 @@ RUN addgroup -g 1000 node \

USER node

CMD [ "node", "app/main.js" ]
CMD [ "node", "app/main.cjs" ]
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test:coverage": "vitest run --coverage",
"test": "vitest",
"test:ci": "vitest run",
"build": "tsc",
"build": "esbuild src/main.ts --bundle --platform=node --target=node16 --format=cjs --outfile=dist/main.cjs --minify",
"format": "prettier -w src",
"lint": "tsc --noEmit && eslint ./src && prettier -c src",
"lint:fix": "eslint --fix ./src && prettier -w src"
Expand All @@ -31,6 +31,7 @@
"@types/express": "^4.17.21",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@vitest/coverage-v8": "^1.1.3",
"esbuild": "^0.20.0",
"eslint": "^8.56.0",
"prettier": "^3.1.1",
"tsx": "^4.7.0",
Expand Down
Loading

0 comments on commit 7b62619

Please sign in to comment.