Commit Graph

16 Commits

Author SHA1 Message Date
Kim Alvefur
9672cd6870 Install as many packages as possible from Debian
The only missing piece appears to be environ-config.

This **fails to start** with

```
ImportError: cannot import name '_app_ctx_stack' from 'quart' (/usr/lib/python3/dist-packages/quart/__init__.py)
```
2023-10-04 23:27:05 +02:00
Kim Alvefur
d3a6be7bec Switch base image to Debian 12 2023-08-07 08:47:55 +02:00
Kim Alvefur
7a4b56914c Switch to sassc for CSS building
Because https://github.com/Kronuz/pyScss/pull/426 is not yet in a
release, also just look at the diffstat!
2023-08-02 22:35:32 +02:00
Jonas Schäfer
0ac4ab8142 Install netcat in final image instead of build image
`nc` (from netcat) is required for the healthcheck. In
c1cf6ab1e5, the installation was
erroneously moved to the builder image, instead of the final image, so
it was missing since then from the actual application image, causing it
to always show as unhealthy.

Fixes #126.
2022-02-05 13:51:30 +01:00
Matthew Wild
344a4d3e93 Dockerfile: Add dev headers required for building deps 2022-02-01 09:04:25 +00:00
Matthew Wild
b036caa85e Dockerfile: Ensure a compiler is available while pip-installing requirements
Dependencies are not necessarily packaged for all architectures. In some cases
(such as aiohttp, and others, on ARM) pip will attempt to compile the
dependency from scratch. Since switching to multi-stage builds, we have been
installing these without a compiler present which caused the build to fail on
ARM architectures.

This commit temporarily installs build-essential packages while running pip,
then removes them again afterwards.
2022-01-31 21:45:39 +00:00
Jonas Schäfer
6aa6e12680 Fix error handling when building image
Apparently, we managed to publish an image without working aiohttp
because of this.

Partially a regression from 5d7183a.
2022-01-31 19:09:03 +01:00
Kim Alvefur
b545c137b1 Dockerfile: Switch base image to Debian 11 2022-01-10 16:27:38 +01:00
Jonas Schäfer
5d7183a0b8 Reinstate cache deletion in multi-stage build
Previously, the multi-stage build increased the image size by about 30
MiB (163MiB -> 191MiB). Dropping the caches reduces the image size down
to 159MiB, leading to a net improvement of 4 MiB.
2022-01-08 13:29:28 +01:00
Matthew Wild
c1cf6ab1e5 Dockerfile: Split build into multiple stages
Currently the Dockerfile has a single RUN directive with all the needed
commands in it. This optimizes for image size by not creating too many
"layers" (which are only additive). However it means the result that gets
cached can basically never be reused, because any change to the source code
will need to execute the whole RUN block again.

This commit switches to a docker "multi-stage" build, where we have a build
image that is separate from the final one that gets published. The build
image can be cached locally, and size is no longer a significant concern.

This approach allows the single RUN command to be split up into multiple RUN
commands that only execute when strictly needed (i.e. when their result
is not cached locally).

This drastically improves the build time when rebuilding the image after
a simple code change, because the build image doesn't have to install all
the apt packages, for example. This leads to a nicer developer experience
when using docker locally for development and testing.
2022-01-08 13:17:52 +01:00
Matthew Wild
531565d55c Automatically determine version from build info or git 2021-05-31 11:20:39 +01:00
Kim Alvefur
53aac690df Add health check to dockerfile 2021-02-23 15:56:19 +01:00
Jonas Schäfer
52f0bee006 Use buster-slim as base image
This reduces the overall image size, but more importantly,
deduplicates nicely with the other Snikket images which all use
buster-slim as base.

Fixes #63.
2021-02-22 15:02:14 +01:00
Jonas Schäfer
725dffc458 Reduce image size by approximately 65% 2021-02-03 18:36:31 +01:00
Matthew Wild
f27c86e29a Initialize required environment variables appropriately 2021-01-29 13:59:30 +00:00
Matthew Wild
b7a870c427 Dockerfile: Move to repo root to match our other projects 2021-01-22 12:00:26 +00:00