-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Moving to pnpm and ditching nx #727
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,5 @@ | ||
ignore-workspace-root-check=true | ||
node-linker=hoisted | ||
restrict-manifest-changes=true | ||
sync-injected-deps-after-scripts[]=build | ||
inject-workspace-packages=true |
This file contains hidden or 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 |
---|---|---|
@@ -1,78 +1,19 @@ | ||
# This Dockerfile is used for producing 3 container images. | ||
# | ||
# base - which is thrown away, that contains node and the basic infrastructure. | ||
# devcontainer - which is used for development, and contains the source code and the node_modules. | ||
# dist - which is used for production, and contains the built source code and the node_modules. | ||
|
||
ARG NODE_VERSION="20.17" | ||
|
||
# Base image | ||
FROM docker.io/node:${NODE_VERSION}-alpine3.19 AS base | ||
|
||
## Just reduce unccessary noise in the logs. | ||
ENV NPM_CONFIG_UPDATE_NOTIFIER=false | ||
ENV NEXT_TELEMETRY_DISABLED=1 | ||
|
||
RUN apk add --no-cache \ | ||
caddy \ | ||
bash=5.2.21-r0 \ | ||
supervisor=4.2.5-r4 | ||
FROM node:20-alpine3.19 | ||
RUN apk add --no-cache g++ make py3-pip supervisor bash caddy | ||
RUN npm --no-update-notifier --no-fund --global install [email protected] pm2 | ||
|
||
WORKDIR /app | ||
|
||
EXPOSE 3000 | ||
EXPOSE 4200 | ||
EXPOSE 5000 | ||
|
||
COPY var/docker/entrypoint.sh /app/entrypoint.sh | ||
COPY . /app | ||
COPY var/docker/supervisord.conf /etc/supervisord.conf | ||
COPY var/docker/supervisord /app/supervisord_available_configs/ | ||
COPY var/docker/Caddyfile /app/Caddyfile | ||
COPY .env.example /config/postiz.env | ||
|
||
VOLUME /config | ||
VOLUME /uploads | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/gitroomhq/postiz-app | ||
|
||
ENTRYPOINT ["/app/entrypoint.sh"] | ||
|
||
# Builder image | ||
FROM base AS devcontainer | ||
|
||
RUN apk add --no-cache \ | ||
pkgconfig \ | ||
gcc \ | ||
pixman-dev \ | ||
cairo-dev \ | ||
pango-dev \ | ||
make \ | ||
build-base | ||
|
||
COPY nx.json tsconfig.base.json package.json package-lock.json build.plugins.js /app/ | ||
COPY apps /app/apps/ | ||
COPY libraries /app/libraries/ | ||
|
||
RUN npm ci --no-fund && npx nx run-many --target=build --projects=frontend,backend,workers,cron | ||
|
||
VOLUME /config | ||
VOLUME /uploads | ||
|
||
LABEL org.opencontainers.image.title="Postiz App (DevContainer)" | ||
|
||
# Output image | ||
FROM base AS dist | ||
|
||
COPY --from=devcontainer /app/node_modules/ /app/node_modules/ | ||
COPY --from=devcontainer /app/dist/ /app/dist/ | ||
|
||
# Required for prisma | ||
COPY --from=devcontainer /app/libraries/ /app/libraries/ | ||
COPY var/docker/entrypoint.sh /app/entrypoint.sh | ||
COPY var/docker/supervisord/caddy.conf /etc/supervisor.d/caddy.conf | ||
RUN chmod +x /app/entrypoint.sh | ||
|
||
COPY package.json nx.json /app/ | ||
RUN pnpm install | ||
RUN pnpm run build | ||
|
||
VOLUME /config | ||
VOLUME /uploads | ||
EXPOSE 4200 | ||
|
||
## Labels at the bottom, because CI will eventually add dates, commit hashes, etc. | ||
LABEL org.opencontainers.image.title="Postiz App (Production)" | ||
CMD ["pnpm", "run", "pm2"] |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,8 @@ | ||
dist/ | ||
node_modules/ | ||
[._]*.s[a-v][a-z] | ||
[._]*.sw[a-p] | ||
[._]s[a-rt-v][a-z] | ||
[._]ss[a-gi-z] | ||
[._]sw[a-p] | ||
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,20 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/nest-cli", | ||
"collection": "@nestjs/schematics", | ||
"monorepo": false, | ||
"sourceRoot": "src", | ||
"entryFile": "../../dist/backend/apps/backend/src/main", | ||
"language": "ts", | ||
"generateOptions": { | ||
"spec": false | ||
}, | ||
"compilerOptions": { | ||
"manualRestart": true, | ||
"tsConfigPath": "./tsconfig.build.json", | ||
"webpack": false, | ||
"deleteOutDir": true, | ||
"assets": [], | ||
"watchAssets": false, | ||
"plugins": [] | ||
} | ||
} |
This file contains hidden or 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,14 @@ | ||
{ | ||
"name": "postiz-backend", | ||
"version": "1.0.0", | ||
"description": "", | ||
"scripts": { | ||
"dev": "dotenv -e ../../.env -- nest start --watch --entryFile=./apps/backend/src/main", | ||
"build": "NODE_ENV=production nest build", | ||
"start": "dotenv -e ../../.env -- node ./dist/apps/backend/src/main.js", | ||
"pm2": "pm2 start pnpm --name backend -- start" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,23 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"], | ||
"compilerOptions": { | ||
"module": "CommonJS", | ||
"resolveJsonModule": true, | ||
"declaration": true, | ||
"removeComments": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"allowSyntheticDefaultImports": true, | ||
"target": "ES2021", | ||
"sourceMap": true, | ||
"incremental": true, | ||
"skipLibCheck": true, | ||
"strictNullChecks": false, | ||
"noImplicitAny": false, | ||
"strictBindCallApply": false, | ||
"forceConsistentCasingInFileNames": false, | ||
"noFallthroughCasesInSwitch": false, | ||
"outDir": "./dist" | ||
} | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,17 +1,12 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.app.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
], | ||
"compilerOptions": { | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true | ||
"module": "commonjs", | ||
"declaration": true, | ||
"removeComments": true, | ||
"allowSyntheticDefaultImports": true, | ||
"target": "es2017", | ||
"sourceMap": true, | ||
"esModuleInterop": true | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Entry file path likely misconfigured
entryFile
should point to the source entry (e.g.,main.ts
) undersrc
, not the compiled output. Update to avoid CLI errors:📝 Committable suggestion