Skip to content

Commit

Permalink
chore: add dockerfile for build of a demo image
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Cavy committed Dec 20, 2024
1 parent 0c36cbc commit fce3eb5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docker-demo/Dockerfile-pg-embeded
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM postgres:17.2

RUN set -eux; \
apt-get update; \
apt-get install -y default-jre netcat-traditional;

RUN mkdir /app
#RUN groupadd -g 10001 javauser && useradd -u 10000 -g javauser javauser
ENV IZANAMI_CONTAINERIZED=true
COPY ../target/izanami.jar /app/izanami.jar
COPY script.sh /app/script.sh
RUN chmod +x /app/script.sh

#WORKDIR /app
RUN chown -R postgres:postgres /app
#USER postgres
CMD ["/bin/sh", "/app/script.sh"]
9 changes: 9 additions & 0 deletions docker-demo/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/usr/local/bin/docker-entrypoint.sh postgres&

echo "Waiting postgres to launch on 5432..."

while ! nc -z localhost 5432; do
sleep 0.1 # wait for 1/10 of the second before check again
done

java -jar /app/izanami.jar

0 comments on commit fce3eb5

Please sign in to comment.