postiz-app
postiz-app copied to clipboard
setup pnpm and Dockerfile
- What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) We need a good production Dockerfile. Dev can come later as the dev environment itself will need to be handled carefully, but sans-Docker, pnpm is a great candidate for establishing some standards in our environments.
Using pnpm for package management over npm
For one, this enforces the node version to be 20.9.0
That's right, no matter what command you use, pnpm will make sure its on the right version of docker.
-
Why was this change needed? (You can also link to an open issue here) One of our chief problems is "it works on my machine". I aim to fix that.
-
Aligns package versions using pnpm which is great for maintaining package integrity with it's lockfile system:
See: https://pnpm.io/motivation & https://pnpm.io/feature-comparison
- Sets up a
Dockerfile(WIP) for building the Production image ofpostiz-appusing a multi-stage build.
This will need CI and also some other things that are still missing in deps since those items will need to be added to CLI (like Python which I added in Docker)
- Other information:
@jonathan-irvin is attempting to deploy a commit to the Listinai Team on Vercel.
A member of the Team first needs to authorize it.
One more thing, look at this thread on X: https://x.com/nevodavid/status/1830513523014987954
I also thought, like you, that if you run nx run-many with production variables and build it runs it for a production env.
But it doesn't.
When running the project, make sure you run it with node dir.
This is why I created
"start:prod"
"start:prod:frontend"
"start:prod:workers"
"start:prod:cron"
The only one that can start with the next command is the front end. you will see memory drops from 3.4gb to 135mb
@jonathan-irvin as per recent discussions, does it make sense to close this in favour of us jointly working on #205 ?