diff --git a/Dockerfile b/Dockerfile index 4a115569e4d4d9388f71d3074c86d33886f10cf8..c63b8c935352a9ce2dfcf6d8128e85b63bf3293c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,22 @@ FROM debian:buster +ARG LUFI_BUILD_VERSION=0.04.6 + +ARG TINI_BUILD_VERSION=v0.18.0 + RUN apt-get update \ -&& apt-get -yq install build-essential libssl-dev libio-socket-ssl-perl liblwp-protocol-https-perl libpq-dev git \ -&& cpan -a && cpan Carton \ -&& git clone https://framagit.org/fiat-tux/hat-softwares/lufi.git /lufi +&& apt-get -yq install build-essential libssl-dev libio-socket-ssl-perl liblwp-protocol-https-perl libpq-dev wget unzip \ +&& apt-get clean && cpan Carton \ +&& wget https://github.com/ldidry/lufi/archive/${LUFI_BUILD_VERSION}.zip && unzip ${LUFI_BUILD_VERSION}.zip \ +&& wget https://github.com/krallin/tini/releases/download/${TINI_BUILD_VERSION}/tini-amd64 && mv tini-amd64 tini \ +&& rm ${LUFI_BUILD_VERSION}.zip && mv lufi-${LUFI_BUILD_VERSION} lufi COPY lufi.conf /lufi/lufi.conf WORKDIR /lufi -RUN carton install --deployment --without=test --without=sqlite --without=mysql - -VOLUME /lufi/data /lufi/files +RUN carton install --deployment --without=test --without=sqlite --without=mysql && chmod +x /tini -ADD tini /tini - -RUN chmod +x /tini ENTRYPOINT ["/tini", "--"] -EXPOSE 8081 - CMD ["carton", "exec", "hypnotoad", "-f", "/lufi/script/lufi"] diff --git a/docker-compose.yml b/docker-compose.yml index 67a9820360145d34a2193906413732ffbdf6bba7..de40219acc1d1c9cbc4e711dd56ad584af5c1969 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,10 @@ version: '3' services: lufidb: - image: postgres + image: postgres:12 container_name: lufidb restart: always - networks: - - lufi - environment: - - POSTGRES_PASSWORD=passwd - - POSTGRES_USER=lufidb + env_file: lufi.secrets volumes: - /var/lib/postgresql/data lufi: @@ -18,12 +14,6 @@ services: - lufidb ports: - 8081:8081 - networks: - - lufi volumes: - /lufi/data - /lufi/files - -networks: - lufi: - external: true diff --git a/lufi.conf b/lufi.conf index 8bde43b25d31e8c6ba79e2a9db2620f177731913..01ce1c0a2f8fd25c7261dfaf6348959bdb9e7985 100644 --- a/lufi.conf +++ b/lufi.conf @@ -10,7 +10,7 @@ listen => ['http://0.0.0.0:8081'], # if you use Lufi behind a reverse proxy like Nginx, you want to set proxy to 1 # if you use Lufi directly, let it commented - #proxy => 1, + proxy => 1, # Please read http://mojolicious.org/perldoc/Mojo/Server/Hypnotoad#workers # to adjust this to your server diff --git a/lufi.secrets b/lufi.secrets new file mode 100644 index 0000000000000000000000000000000000000000..972dcbf63eccafade146030b48eb67d2838bf630 --- /dev/null +++ b/lufi.secrets @@ -0,0 +1,2 @@ +POSTGRES_PASSWORD = passwd, + diff --git a/tini b/tini deleted file mode 100644 index 03af82f09e6484df819313cf9fec158d6b4a879d..0000000000000000000000000000000000000000 Binary files a/tini and /dev/null differ