Add Dockefile for the application and demo database
This commit is contained in:
commit
28121cb3c6
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
numerus:
|
||||
driver: bridge
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
args:
|
||||
user: numerus
|
||||
uid: 1000
|
||||
context: numerus/
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- PGHOST=db
|
||||
- PGUSER=numerus
|
||||
- PGPASSWORD=numerus
|
||||
- PGDATABASE=numerus
|
||||
ports:
|
||||
- '8083:8080'
|
||||
networks:
|
||||
- numerus
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
build:
|
||||
context: postgres/
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
environment:
|
||||
- POSTGRES_DB=numerus
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
- NUMERUS_USER=numerus
|
||||
- NUMERUS_PASSWORD=numerus
|
||||
networks:
|
||||
- numerus
|
|
@ -0,0 +1,19 @@
|
|||
FROM debian:bullseye
|
||||
|
||||
RUN set -eux \
|
||||
&& apt-get update \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get install -y curl gpg \
|
||||
&& curl https://build.opensuse.org/projects/home:jfita:numerus/public_key | gpg --dearmor -o /etc/apt/trusted.gpg.d/obs-numerus.gpg \
|
||||
&& echo 'deb [signed-by=/etc/apt/trusted.gpg.d/obs-numerus.gpg] http://download.opensuse.org/repositories/home:/jfita:/numerus/Debian_11/ ./' >> /etc/apt/sources.list.d/numerus.list \
|
||||
&& apt-get remove --purge -y curl gpg \
|
||||
&& apt-get autoremove --purge -y \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y numerus \
|
||||
&& apt-get clean
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
WORKDIR /usr/share/numerus
|
||||
|
||||
CMD ["numerus"]
|
|
@ -0,0 +1,16 @@
|
|||
FROM postgres:14-bullseye
|
||||
|
||||
RUN set -eux \
|
||||
&& apt-get update \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get install -y curl gpg \
|
||||
&& curl https://build.opensuse.org/projects/home:jfita:numerus/public_key | gpg --dearmor -o /etc/apt/trusted.gpg.d/obs-numerus.gpg \
|
||||
&& echo 'deb [signed-by=/etc/apt/trusted.gpg.d/obs-numerus.gpg] http://download.opensuse.org/repositories/home:/jfita:/numerus/Debian_11/ ./' >> /etc/apt/sources.list.d/numerus.list \
|
||||
&& apt-get remove --purge -y curl gpg \
|
||||
&& apt-get autoremove --purge -y \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y numerus-sqitch numerus-demo \
|
||||
&& ln /usr/share/numerus/demo.sql /docker-entrypoint-initdb.d/01-demo.sql \
|
||||
&& apt-get clean
|
||||
|
||||
COPY deploy.sh /docker-entrypoint-initdb.d/00-deploy.sh
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cd /usr/share/numerus/sqitch
|
||||
PGUSER="$POSTGRES_USER" PGDATABASE="$POSTGRES_DB" sqitch deploy
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
||||
CREATE ROLE "${NUMERUS_USER:-numerus}" LOGIN PASSWORD '${NUMERUS_PASSWORD:-numerus}' IN ROLE authenticator
|
||||
EOSQL
|
||||
|
Loading…
Reference in New Issue