allow custom java_opts in unifi

This commit is contained in:
Adrien le Maire 2020-08-28 09:46:57 +02:00
parent 43ec276f26
commit e293638415
5 changed files with 4 additions and 110 deletions

View File

@ -27,26 +27,6 @@ unifi:
variables:
- $CI_COMMIT_REF_PROTECTED == "true"
dev-pgadmin4:
stage: build
tags:
- docker
script:
- make pgadmin4-nopush
only:
variables:
- $CI_COMMIT_REF_PROTECTED == "false"
pgadmin4:
stage: build
tags:
- docker
script:
- make pgadmin4
only:
variables:
- $CI_COMMIT_REF_PROTECTED == "true"
dev-mc:
stage: build
tags:

View File

@ -1,2 +0,0 @@
VERSION=4.24
GUNICORN_VERSION=20.0.4

View File

@ -1,72 +0,0 @@
FROM postgres:9.5 as pg95-builder
FROM postgres:9.6 as pg96-builder
FROM postgres:10 as pg10-builder
FROM postgres:11 as pg11-builder
FROM postgres:12 as pg12-builder
FROM debian:stable-20200720-slim as tool-builder
# Copy the PG binaries
COPY --from=pg95-builder /usr/lib/postgresql/9.5/bin/pg_dump /usr/local/pgsql/pgsql-9.5/
COPY --from=pg95-builder /usr/lib/postgresql/9.5/bin/pg_dumpall /usr/local/pgsql/pgsql-9.5/
COPY --from=pg95-builder /usr/lib/postgresql/9.5/bin/pg_restore /usr/local/pgsql/pgsql-9.5/
COPY --from=pg95-builder /usr/lib/postgresql/9.5/bin/psql /usr/local/pgsql/pgsql-9.5/
COPY --from=pg96-builder /usr/lib/postgresql/9.6/bin/pg_dump /usr/local/pgsql/pgsql-9.6/
COPY --from=pg96-builder /usr/lib/postgresql/9.6/bin/pg_dumpall /usr/local/pgsql/pgsql-9.6/
COPY --from=pg96-builder /usr/lib/postgresql/9.6/bin/pg_restore /usr/local/pgsql/pgsql-9.6/
COPY --from=pg96-builder /usr/lib/postgresql/9.6/bin/psql /usr/local/pgsql/pgsql-9.6/
COPY --from=pg10-builder /usr/lib/postgresql/10/bin/pg_dump /usr/local/pgsql/pgsql-10/
COPY --from=pg10-builder /usr/lib/postgresql/10/bin/pg_dumpall /usr/local/pgsql/pgsql-10/
COPY --from=pg10-builder /usr/lib/postgresql/10/bin/pg_restore /usr/local/pgsql/pgsql-10/
COPY --from=pg10-builder /usr/lib/postgresql/10/bin/psql /usr/local/pgsql/pgsql-10/
COPY --from=pg11-builder /usr/lib/postgresql/11/bin/pg_dump /usr/local/pgsql/pgsql-11/
COPY --from=pg11-builder /usr/lib/postgresql/11/bin/pg_dumpall /usr/local/pgsql/pgsql-11/
COPY --from=pg11-builder /usr/lib/postgresql/11/bin/pg_restore /usr/local/pgsql/pgsql-11/
COPY --from=pg11-builder /usr/lib/postgresql/11/bin/psql /usr/local/pgsql/pgsql-11/
COPY --from=pg12-builder /usr/lib/postgresql/12/bin/pg_dump /usr/local/pgsql/pgsql-12/
COPY --from=pg12-builder /usr/lib/postgresql/12/bin/pg_dumpall /usr/local/pgsql/pgsql-12/
COPY --from=pg12-builder /usr/lib/postgresql/12/bin/pg_restore /usr/local/pgsql/pgsql-12/
COPY --from=pg12-builder /usr/lib/postgresql/12/bin/psql /usr/local/pgsql/pgsql-12/
FROM debian:bullseye-20200720-slim
ARG DEBIAN_FRONTEND=noninteractive
ADD https://curl.haxx.se/ca/cacert.pem /etc/ssl/certs/cacert.pem
ENV CURL_CA_BUNDLE=/etc/ssl/certs/cacert.pem
COPY --from=tool-builder /usr/local/pgsql /usr/local/
ARG TARGETARCH
ARG VERSION=4.24
RUN export GH_VERSION=$(echo ${VERSION} | tr '.' '_') && \
apt update -qq && \
apt install -qqy --no-install-recommends curl python3-pip gunicorn build-essential python3-dev && \
apt install -qqy --no-install-recommends python3-flask-mail python3-flask-principal python3-flask-compress && \
apt install -qqy --no-install-recommends python3-blinker python3-werkzeug python3-passlib python3-six && \
apt install -qqy --no-install-recommends python3-speaklater python3-wtforms python3-sqlalchemy python3-sshtunnel python3-ldap3 && \
pip3 install --no-cache-dir pgadmin4==${VERSION} && \
ln -s /usr/local/lib/python3.7/dist-packages/pgadmin4 /pgadmin4 && \
ln -s /usr/bin/python3 /usr/bin/python && \
groupadd -g 5050 pgadmin && \
useradd -r -u 5050 -g pgadmin pgadmin && \
mkdir -p /var/lib/pgadmin && \
chown pgadmin:pgadmin /var/lib/pgadmin && \
mkdir -p /var/log/pgadmin && \
chown pgadmin:pgadmin /var/log/pgadmin && \
touch /pgadmin4/config_distro.py && \
chown pgadmin:pgadmin /pgadmin4/config_distro.py && \
curl -o /pgadmin4/run_pgadmin.py https://raw.githubusercontent.com/postgres/pgadmin4/REL-${GH_VERSION}/pkg/docker/run_pgadmin.py && \
curl -o /entrypoint.sh https://raw.githubusercontent.com/postgres/pgadmin4/REL-${GH_VERSION}/pkg/docker/entrypoint.sh && \
chmod +x /entrypoint.sh && \
apt remove -qqy python3-dev python3-pip libpq-dev build-essential libffi-dev curl && \
apt autoremove -qqy && rm -rf /var/lib/apt/lists/*
WORKDIR /pgadmin4
USER 5050
VOLUME /var/lib/pgadmin
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -1,15 +0,0 @@
include pgadmin4/.version
pgadmin4-nopush:
docker buildx build --platform linux/amd64 --load \
--build-arg VERSION=$(VERSION) \
--build-arg GUNICORN_VERSION=$(GUNICORN_VERSION) \
--tag alemairebe/pgadmin4:$(VERSION) pgadmin4
pgadmin4:
docker buildx build --platform linux/amd64,linux/arm64,linux/arm --push \
--build-arg VERSION=$(VERSION) \
--build-arg GUNICORN_VERSION=$(GUNICORN_VERSION) \
--cache-from=type=registry,ref=alemairebe/pgadmin4:buildx \
--cache-to=type=registry,ref=alemairebe/pgadmin4:buildx \
--tag alemairebe/pgadmin4:$(VERSION) pgadmin4

View File

@ -20,6 +20,9 @@ RUN ln -s /var/lib/unifi /usr/lib/unifi/data
EXPOSE 8080/tcp 8443/tcp 8843/tcp 8880/tcp 3478/udp
WORKDIR /var/lib/unifi
ENV JAVA_OPTS -Xmx512M
COPY entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
ENTRYPOINT ["/usr/bin/tini", "-g", "--", "/usr/bin/java", "-Xmx512M", "-jar", "/usr/lib/unifi/lib/ace.jar"]
CMD ["start"]