Build postgres using dockerfile
- use dockerfile to install postgis during build
This commit is contained in:
parent
ba19ee9125
commit
3dbe85853e
|
@ -4,8 +4,16 @@
|
|||
backend = "docker";
|
||||
projects = {
|
||||
"db".settings.services."db".service = {
|
||||
image = "postgres:16";
|
||||
restart = "unless-stopped";
|
||||
build.context = "/nix/store";
|
||||
build.dockerfile = builtins.baseNameOf "${pkgs.writeScript "pgDockerfile" ''
|
||||
FROM postgres:16
|
||||
# install packages
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
postgresql-16-postgis \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
''}";
|
||||
environment = {
|
||||
POSTGRES_PASSWORD = "balls1234";
|
||||
POSTGRES_USER = "admin";
|
||||
|
|
Loading…
Reference in New Issue