20 Commits

Author SHA1 Message Date
FoxxMD
d684ecc0ff docs: Add memory management notes
* Document memory management approaches
* Change node args for docker to a better name (NODE_ARGS)
* Implement default node arg for docker `--max_old_space_size=512`
2022-07-25 12:20:02 -04:00
FoxxMD
e2824ea94c chore(docker): Remove superfluous dev packages from final docker layer #88
typeorm depends on ts-node as an *optional peer* dependency -- ts-node can be used in the typeorm cli to parse entities and run migrations.

However CM doesn't use typeorm CLI for running production so its not needed. And ts-node depends on typescript so npm install --production always installs both at about ~30MB.

I couldn't find a good way to remove peer deps ONLY for typeorm so instead just manually remove the folders from the prod install in the final layer of the docker.
2022-05-24 10:31:15 -04:00
FoxxMD
b670ad73c4 refactor(docker): Improve data directory flexibility and build order
* Create data directory if not /config
* Copy s6 files in base to make incremental builds faster
2022-04-07 15:23:14 -04:00
FoxxMD
6764995dfe refactor(docker)!: Switch to linuxserverio.io alpine as base and re-work init to make permissions less rigid
* Switching to lsio as base means inclusion of s6-overlay for improved init, handling of default permissions, and a maintained base for security/bug fixes
* Also means we can use PUID and PGID as variables instead of requiring --user in run command (more friendly to unraid, portainer, etc...)
* BREAKING: mount directory for configuration,etc. has been changed to /config by default to align with lsio
2022-04-07 14:58:10 -04:00
FoxxMD
11be4085be refactor(docker): Reclaim some space
* Clear npm cache after final production install to reclaim 100MB on image size
* More comprehensive dockerignore to prevent accidentally including development files
2022-04-07 13:10:33 -04:00
FoxxMD
2e8f90c1a8 feat(database): More database and config improvements for startup
* Improve errors when checking if file is readable or directory/file is writable
* Implement custom winston-typeorm logging mappings so migrations are output at INFO level
* Add typeorm logging options to database config and default to displaying error, warning, and migrations
* Ensure directory is writeable before using log rotation transport for winston
* Move init logger into index so its always available
* Simplify printing stack for SimpleError when it's a cause
* Better handling for access permissions when reading operator config file
* Add hint to errors relating to permissions access if app detects its running in docker
2022-03-31 13:05:07 -04:00
FoxxMD
e9b76bc503 refactor(docker): Improve permissions and set default db driver
* Change project location to /home/node to avoid root permissions when creating WORKDIR
* Create default config directory with correct permissions in the event no volume is mounted
* Set default db driver to better-sqlite3 since we control environment -- it has better performance and we know we can use a pre-built binary b/c of base docker image
2022-03-30 16:20:07 -04:00
FoxxMD
cf909d49cc refactor(docker): Provide a default DATA_DIR to simplify mount binding 2022-03-30 12:56:41 -04:00
FoxxMD
e4dfa9dde3 refactor(docker): reduce image size with best practices
* use --no-cache so repository index isn't included in image
* use FROM instructions to build project with dev dependencies, then copy built project to new stage and install production-only libraries
* properly ignore docs and node_modules with dockerignore
2021-12-17 15:10:22 -05:00
FoxxMD
2504a34a34 refactor(docker): Remove old steps from node-canvas dep
Not using node-canvas anymore so dockerfile can be simplified #48
2021-11-01 15:55:12 -04:00
FoxxMD
4d8d3dc266 fix(docker): Add libvips dependency 2021-10-08 13:47:35 -04:00
FoxxMD
fe66a2e8f7 fix(docker): Update build to build node-canvas from source 2021-09-23 10:08:26 -04:00
FoxxMD
7cda47183f Simplify cli options and improve web server checks
* Check for in-use web port before starting so we can display a useful error message
* Remove 'web' command and instead make it an optional argument for `run` (default to web)
* Update dockerfile to use run command
* Remove remaining commander option defaults since they are defined in config builder now
2021-07-26 12:18:51 -04:00
FoxxMD
f9c7cf433e Switch to web as default run command and provide fallback
* Use 'web' as run command for dockerfile
* If on 'web' there is no redirect uri fallback to cli (doesn't break compatibility this way)
2021-07-15 15:44:47 -04:00
FoxxMD
6dfb5823ba Add web ui port as configurable 2021-07-15 15:02:41 -04:00
FoxxMD
8cea19c7f2 Remove default env vars 2021-06-08 16:01:18 -04:00
FoxxMD
16f3c2268b Create heroku file 2021-06-08 15:31:34 -04:00
FoxxMD
d239d3c6cc Update dockerfile to use default run command 2021-06-08 00:52:23 -04:00
FoxxMD
76ad00f76f Working dockerfile
Closes #7
2021-06-03 23:44:10 -04:00
FoxxMD
d3daaacf0b Implement dockerfile
#7
2021-06-03 23:16:04 -04:00