From c58d9b8d11ad7022c2dc0ec030b6e27a1854c063 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Wed, 11 Mar 2020 23:34:37 +0100 Subject: [PATCH] Add Dockerfile --- Dockerfile | 30 ++++++++++++++++++++++++++++++ docker-compose.yml | 24 ++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..be0588c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM fpco/stack-build:lts-12.26 AS gonito-build + +MAINTAINER Filip Gralinski + +WORKDIR /root/ + +RUN apt-get -y update && apt-get -y install libfcgi-dev && apt-get clean && rm -rf /var/lib/apt/lists/* + +RUN git clone git://gonito.net/geval && cd geval && git reset --hard 599b08eb2beb207b81073acb9626696f7f0e0171 +RUN git clone git://gonito.net/gonito && cd gonito && git reset --hard 389a01825445d99b489dfb91faeb207473830752 + +WORKDIR gonito + +RUN stack install && rm -rf /root/.stack + +FROM ubuntu:16.04 AS gonito-run + +RUN apt-get -y update && apt-get -y install libcairo2 libpq5 && apt-get clean && rm -rf /var/lib/apt/lists/* + +RUN mkdir /gonito + +WORKDIR /gonito + +COPY --from=gonito-build /root/.local/bin/gonito-bin ./ + +COPY --from=gonito-build /root/gonito/static static + +COPY --from=gonito-build /root/gonito/config config + +CMD ./gonito-bin diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..665f342 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +version: '3' +services: + gonito: + image: loxygen/gonito + depends_on: + - postgres + environment: + - PGUSER=postgres + - PGPASS=$POSTGRES_PASSWORD + - PGHOST=postgres + - ADMINUSER=$GONITO_ADMINUSER + - ADMINPASS=$GONITO_ADMINPASS + - LOCATION=$GONITO_LOCATION + ports: + - "3000:3000" + postgres: + image: postgres + environment: + - POSTGRES_PASSWORD=$POSTGRES_PASSWORD + - POSTGRES_DB=gonito + expose: + - "5432" + volumes: + - "${PG_DATA_VOLUME}:/var/lib/postgresql/data"