Skip to content

Commit 948a261

Browse files
committed
Fix postgres and environment
- build babashka during image build - install process compose - set postgres environment - initialize db directory - export babashka environment through bashrc
1 parent 7460d24 commit 948a261

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

play/Dockerfile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,18 @@ RUN --mount=type=cache,target=/home/app/.asdf/downloads,uid=1000,gid=1000 \
4444
make install-tools && \
4545
make build
4646

47-
WORKDIR /src
47+
ENV POSTGRES_DB="testdb"
48+
ENV POSTGRES_HOST_AUTH_METHOD="trust"
49+
ENV POSTGRES_PASSWORD="password"
50+
ENV POSTGRES_USER="app"
51+
52+
53+
RUN sh -c "$(curl --location https://raw.githubusercontent.com/F1bonacc1/process-compose/main/scripts/get-pc.sh)" -- -d -b /home/app/.asdf/bin
54+
USER root
55+
RUN ln -s /tmp/.s.PGSQL.5432 /var/run/.s.pgsql.5432
56+
USER 1000
57+
RUN bash -c "mkdir -p /src/play/work/db && /home/app/.asdf/shims/initdb /src/play/work/db"
58+
WORKDIR /src/play
59+
60+
RUN bb --config /src/play/bb.edn build-all && clojure -T:build
61+
RUN echo '. /src/play/.envrc' >> ~/.bashrc

0 commit comments

Comments
 (0)