Build postgres using dockerfile
- use dockerfile to install postgis during build
This commit is contained in:
parent
f71ece31f1
commit
d29250a2a6
|
@ -4,8 +4,16 @@
|
||||||
backend = "docker";
|
backend = "docker";
|
||||||
projects = {
|
projects = {
|
||||||
"db".settings.services."db".service = {
|
"db".settings.services."db".service = {
|
||||||
image = "postgres:16";
|
|
||||||
restart = "unless-stopped";
|
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 = {
|
environment = {
|
||||||
POSTGRES_PASSWORD = "balls1234";
|
POSTGRES_PASSWORD = "balls1234";
|
||||||
POSTGRES_USER = "admin";
|
POSTGRES_USER = "admin";
|
||||||
|
|
Loading…
Reference in New Issue