Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BRMO-284] Gebruik Alpine Linux bases images voor BAG en BGT loader #1709

Merged
merged 1 commit into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions bag2-loader/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#
# SPDX-License-Identifier: MIT

FROM eclipse-temurin:11.0.18_10-jre
FROM eclipse-temurin:11.0.18_10-jre-alpine

LABEL org.opencontainers.image.source=https://github.com/b3partners/brmo/bag2-loader

ARG BRMO_VERSION=3.0.0-SNAPSHOT
ARG BRMO_VERSION=3.0.1-SNAPSHOT
ARG DEBIAN_FRONTEND="noninteractive"
ARG TZ="Europe/Amsterdam"

Expand All @@ -20,27 +20,20 @@ LABEL org.opencontainers.image.authors="support@b3partners.nl" \

RUN set -eux; \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apt-get update \
&& apt-get install -y --no-install-recommends locales tzdata \
&& apt-get install -y dumb-init \
&& apt-get -y --purge autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& sed -i 's/# nl_NL.UTF-8 UTF-8/nl_NL.UTF-8 UTF-8/' /etc/locale.gen \
&& locale-gen "nl_NL.UTF-8"
&& apk upgrade --update \
&& apk -U add --no-cache tzdata musl-locales dumb-init \
&& rm -rf /tmp/* /var/cache/apk/* /var/tmp/*

ENV LANG=nl_NL.UTF-8 LANGUAGE=nl_NL:nl LC_ALL=nl_NL.UTF-8
ENV LANG=nl_NL.UTF-8 LANGUAGE=nl_NL:nl LC_ALL=nl_NL.UTF-8 TZ=$TZ

RUN useradd --user-group --system user -s /bin/false
RUN addgroup user && adduser -G user -S -s /bin/false -H user

COPY target/lib/ /app/lib/
COPY target/bag2-loader-*.jar /app
COPY target/bag2-loader.jar /app

WORKDIR /app
RUN chown -R user:user /app
USER user

RUN ln -s bag2-loader-*.jar bag2-loader.jar

ENTRYPOINT ["dumb-init", "java","-jar","/app/bag2-loader.jar"]

1 change: 1 addition & 0 deletions bag2-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ SPDX-License-Identifier: MIT
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<filtering>true</filtering>
Expand Down
23 changes: 8 additions & 15 deletions bgt-loader/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#
# SPDX-License-Identifier: MIT

FROM eclipse-temurin:11.0.18_10-jre
FROM eclipse-temurin:11.0.18_10-jre-alpine

LABEL org.opencontainers.image.source=https://github.com/b3partners/brmo/bgt-citygml-loader

ARG BRMO_VERSION=3.0.0-SNAPSHOT
ARG BRMO_VERSION=3.0.1-SNAPSHOT
ARG DEBIAN_FRONTEND="noninteractive"
ARG TZ="Europe/Amsterdam"

Expand All @@ -20,27 +20,20 @@ LABEL org.opencontainers.image.authors="support@b3partners.nl" \

RUN set -eux; \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apt-get update \
&& apt-get install -y --no-install-recommends locales tzdata \
&& apt-get install -y dumb-init \
&& apt-get -y --purge autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& sed -i 's/# nl_NL.UTF-8 UTF-8/nl_NL.UTF-8 UTF-8/' /etc/locale.gen \
&& locale-gen "nl_NL.UTF-8"
&& apk upgrade --update \
&& apk -U add --no-cache tzdata musl-locales dumb-init \
&& rm -rf /tmp/* /var/cache/apk/* /var/tmp/*

ENV LANG=nl_NL.UTF-8 LANGUAGE=nl_NL:nl LC_ALL=nl_NL.UTF-8
ENV LANG=nl_NL.UTF-8 LANGUAGE=nl_NL:nl LC_ALL=nl_NL.UTF-8 TZ=$TZ

RUN useradd --user-group --system user -s /bin/false
RUN addgroup user && adduser -G user -S -s /bin/false -H user

COPY target/lib/ /app/lib/
COPY target/bgt-loader-*.jar /app
COPY target/bgt-loader.jar /app

WORKDIR /app
RUN chown -R user:user /app
USER user

RUN ln -s bgt-loader-*.jar bgt-loader.jar

ENTRYPOINT ["dumb-init", "java","-jar","/app/bgt-loader.jar"]

1 change: 1 addition & 0 deletions bgt-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ SPDX-License-Identifier: MIT
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<filtering>true</filtering>
Expand Down
2 changes: 1 addition & 1 deletion docker/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM tomcat:9.0.71-jre11-temurin

ARG TZ="Europe/Amsterdam"
ARG DEBIAN_FRONTEND="noninteractive"
ARG BRMO_VERSION="3.0.0-SNAPSHOT"
ARG BRMO_VERSION="3.0.1-SNAPSHOT"

#ENV MAIL_FROM=brmo-no-reply@b3partners.nl
#ENV MAIL_HOST=mail.b3partners.nl
Expand Down
7 changes: 3 additions & 4 deletions docker/src/main/docker/pg_conf/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM postgis/postgis:15-3.3-alpine

ARG TZ="Europe/Amsterdam"
ARG BRMO_VERSION="3.0.0-SNAPSHOT"
ARG BRMO_VERSION="3.0.1-SNAPSHOT"

#ENV DB_PASS_RSGB=rsgb
#ENV DB_PASS_STAGING=staging
Expand All @@ -17,10 +17,9 @@ LABEL org.opencontainers.image.authors="support@b3partners.nl" \
org.opencontainers.image.source="https://github.com/B3Partners/brmo" \
org.opencontainers.image.version=${BRMO_VERSION}

# get schema export from tailormap persistence
RUN set -eux; \
apk upgrade --update && apk -U add --no-cache tzdata curl unzip \
&& rm -rf /tmp/*
apk upgrade --update && apk -U add --no-cache tzdata unzip \
&& rm -rf /tmp/* /var/cache/apk/* /var/tmp/*

COPY ["bin_unzipped/db/rsgb/datamodel_postgresql.sql", \
"bin_unzipped/db/brk/brk2.0_postgresql.sql", \
Expand Down