Conversation
f165a96 to
c6b7e7c
Compare
Dockerfile
Outdated
| USER node | ||
| EXPOSE 3000/tcp | ||
| EXPOSE 4000/tcp | ||
| EXPOSE 5000/tcp |
There was a problem hiding this comment.
how do we handle exposing app ports? since those are dynamic?
There was a problem hiding this comment.
yes good question one I do not have an answer to
apps/server/src/index.ts
Outdated
| import { initDb } from "./db" | ||
|
|
||
| const appServers: Partial<Record<string, Server>> = {} | ||
| const dataDir = process.env["COATRACK_DATA_DIR"] || "_data" |
There was a problem hiding this comment.
please add types for the env (using a d.ts, you can probably find docs online) and also/alternatively add a Zod schema and make this a bit of a more general config thing
| @@ -0,0 +1,24 @@ | |||
| module.exports = { | |||
There was a problem hiding this comment.
haha are we using pm2 ? docker should be able to keep these alive on its own so this isnt necessary when containerizing is it?
There was a problem hiding this comment.
would maybe leave this out if we dont really need it
There was a problem hiding this comment.
yup pm2, we need it to serve web + sandbox and also host server. otherwise we probably need docker-compose.
There was a problem hiding this comment.
ah okay i see, probably also good to have for hosting outside of docker e.g as an os image
This PR does a couple things:
rootDirin our tsconfigs so that's addeddependenciestodevDependenciesin package.json, otherwise the built file doesn't run due to missing modulesCOATRACK_DATA_DIRenv var for server that specifies where the data directory should be.I decided to use PM2 to serve web + sandbox + run server. Currently web & sandbox are not responding for some reason.
Also, we have a bigger problem, since we're using server as the app "host", and it dynamically picks ports, docker wants to know what the ports are upfront... soooooo we can expose the "known" ports (i.e. 3000, 4000, 5000) but none of the apps in the catalog are exposed.
This is what I'm using to build:
And to run: