Skip to content
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

Apply esbuild in docker #5

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading