in my eyes this is all madness. deploying sites via github to some docker shit. how about good old ftp and a cheap shared webhost? like its been done for 30 years.
Shrinking my static site
31–40 of 107 posts
Re: Shrinking my static site
#32Re: Shrinking my static site
#33 COPY package.json .
RUN npm install
to this: COPY package.json package-lock.json .
RUN npm ci
`npm ci` installs the exact dependencies specified in the lockfile. This way, transitive dependencies that were upgraded via `npm audit fix` are guaranteed to be installed.
It therefore forces the image to be rebuilt when a transitive dependency changes. Copying only the package.json wouldn't do that.
It also errors if the lockfile and the package.json are inconsistent.Re: Shrinking my static site
#34Re: Shrinking my static site
#35Aside: one should not use package.json to install dependencies. Use either package-lock.json (and command "npm ci") or yarn.lock (and... I forget). Keep the lock file as part of repo too, or each build could be different.
Or not working.
Re: Shrinking my static site
#36in my eyes this is all madness. deploying sites via github to some docker shit. how about good old ftp and a cheap shared webhost? like its been done for 30 years.
I don't know about docker and all of that, though.
Re: Shrinking my static site
#37in my eyes this is all madness. deploying sites via github to some docker shit. how about good old ftp and a cheap shared webhost? like its been done for 30 years.
You are right, this IS madness.
Re: Shrinking my static site
#38Re: Shrinking my static site
#39This post says a lot more about the javascript ecosystem than Docker. Multi-stage image builds are nothing new or extraordinary, and in fact it's Docker 101. However, being forced to install 500MB worth of tooling and dependencies just to deploy a measly 30MB static website on nginx is something unbelievable.
How is that any different from build tooling for any other language? On my system, gcc with a bunch of commonly used dependencies requires just about the same space (and it's a full Linux system, not a trimmed down container).
Re: Shrinking my static site
#40I use Hugo as my static site generator, single binary, no dependencies, generating hundreds of pages in milliseconds ... so reading this feels so wrong, I want to call it JavaScript masochism. Taking a simple concept like a static site and adding a ton of complex tooling around it because it is the trend now? Why would you even need a docker image to run a static website? The best thing about a static website us you…