Static Docker production deployment? #9

Closed
opened 2021-04-24 19:45:10 +00:00 by 3wordchant · 0 comments
Owner

Currently the approach to serving files is to define a prod script for npm which runs elm-live, run it as the Docker CMD, and port-forward to that from Traefik.

This seems like kind of a waste of resources and an excessive attack surface. We should just be able to run npm build and then wrap up the public directory into an appropriately-configured Nginx container – but I need to get my head around Docker builds a bit more to work out how this should happen most efficiently.

Currently the approach to serving files is to [define a `prod` script for `npm` which runs `elm-live`](https://git.autonomic.zone/coop-cloud/abra-apps/src/branch/main/package.json#L8), [run it as the Docker `CMD`](https://git.autonomic.zone/coop-cloud/abra-apps/src/branch/main/Dockerfile#L15), and [port-forward to that from Traefik](https://git.autonomic.zone/coop-cloud/abra-apps/src/branch/main/compose.yml#L21). This seems like kind of a waste of resources and an excessive attack surface. We should just be able to run `npm build` and then wrap up the `public` directory into an appropriately-configured Nginx container – but I need to get my head around Docker builds a bit more to work out how this should happen most efficiently.
3wordchant added the
enhancement
question
labels 2021-04-24 19:45:10 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/recipes.coopcloud.tech#9
No description provided.