Skip to content
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

Optimized Dockerfile #365

Closed
wants to merge 1 commit into from
Closed

Conversation

CreativeCactus
Copy link

Based on this PR I have prepared a Dockerfile.

  • Based on alpine (light weight)
  • Build app during docker build (not when container starts, allows pulling built files from image directly)
  • Optimized instructions (copy package.json first, code changes do not require re-running install steps)
  • Reproducible (npm ci respects exact lock file versions)
  • ENTRYPOINT & CMD array syntax (allows overriding the CMD easily when running)
  • npm scripts (to demonstrate basic usage and set conventional image name)
  • Support for hot-reload development inside volumes (untested)

@CreativeCactus
Copy link
Author

I've just tested, and everything works well with 2 notes:

  • I used webpack serve --mode production --env production to serve, but I get dev warnings (about package size) when I load the page. Otherwise it works well. How is MiniPaint usually deployed? I can make the CMD match the normal deployment. I'm guessing it's just a static serve of dist?
  • I got "Invalid host header" when using domain names other than localhost, can/should this be set/disabled by environment variable for docker?

Let me know if you have any questions or would like to use docker for deployments! It will make your life easier! :)

@viliusle
Copy link
Owner

I added your PR into wiki, so everybody can find it easily. There are multiple versions, so I don't want to move it to main code yet.

https://github.com/viliusle/miniPaint/wiki/Docker

@CreativeCactus
Copy link
Author

It looks like the language tag is missing for some of those code blocks.

I think the ghost implementation can be removed, or at least placed last, since it is objectively worse than the two alpine versions.

Do you see these implementations getting merged eventually, or will they remain as wikis?

@viliusle
Copy link
Owner

It looks like the language tag is missing for some of those code blocks.

? Can you give more details?

I think the ghost implementation can be removed, or at least placed last, since it is objectively worse than the two alpine versions.

it is hard to rate these versions, but I will order by date descending, which should work well for most users. Ghost version is last now.

Do you see these implementations getting merged eventually, or will they remain as wikis?

I would like to keep it as is for some time and see how it works. If multiple users will agree on some changes, we can do it in future.

@CreativeCactus
Copy link
Author

See markdownguide

image

image

@viliusle
Copy link
Owner

viliusle commented Apr 21, 2023

Feel free to add more comments or reopen it in future, but for now I am closing it.

p.s. language tags are added.

@viliusle viliusle closed this Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants