-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-trixie.in
90 lines (73 loc) · 3.4 KB
/
Dockerfile-trixie.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# -*- mode: dockerfile; -*- vim: set ft=dockerfile:
FROM debian:trixie-20240513 AS build
RUN groupadd --gid 1000 trip \
&& useradd --uid 1000 --gid trip --shell /bin/bash --create-home trip
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
procps locales coreutils tar xz-utils ca-certificates tzdata \
make g++ gawk \
libboost-locale-dev libpqxx-dev libpugixml-dev libyaml-cpp-dev \
nlohmann-json3-dev uuid-dev cairomm-1.0-dev libgdal-dev libcmark-dev \
texlive texinfo \
&& rm -rf /var/lib/apt/lists/*
RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen && \
export LC_ALL=en_GB.utf8 && \
localedef -i en_GB -c -f UTF-8 -A /usr/share/locale/locale.alias en_GB.UTF-8 && \
update-locale LANG LANGUAGE && \
ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime && \
dpkg-reconfigure tzdata --frontend=noninteractive
ENV LANG en_GB.utf8
ARG TRIP_SERVER_VERSION=@PACKAGE_VERSION@
ARG TRIP_SERVER_FILENAME=trip-${TRIP_SERVER_VERSION}.tar.gz
RUN chgrp trip /usr/local/src && \
chmod g+w /usr/local/src
USER trip
WORKDIR /usr/local/src
# ADD --chown=trip:trip https://www.fdsd.co.uk/trip-server-2/download/${TRIP_SERVER_FILENAME} .
# ARG TRIP_SERVER_SHA256=49fec7ba5d0df588594eee4e39c7afeaf5a61b2467f3c8ee62e94541eaddc3ad
# RUN echo "$TRIP_SERVER_SHA256 *${TRIP_SERVER_FILENAME}" | sha256sum -c -
COPY ./${TRIP_SERVER_FILENAME} .
RUN tar -xf $TRIP_SERVER_FILENAME
WORKDIR "/usr/local/src/trip-${TRIP_SERVER_VERSION}"
RUN ./configure --enable-cairo && make check
RUN make html pdf
USER root
RUN make install install-html install-pdf
WORKDIR /usr/local/etc
FROM debian:trixie-20240513
LABEL uk.co.fdsd.tripserver.version="@PACKAGE_VERSION@"
RUN groupadd --gid 1000 trip \
&& useradd --uid 1000 --gid trip --shell /bin/bash --create-home trip
RUN apt-get update \
&& apt-get full-upgrade --yes --allow-change-held-packages \
&& apt-get install -y --no-install-recommends \
locales tzdata \
libboost-locale1.74.0 libpugixml1v5 libyaml-cpp0.7 \
uuid libpqxx-6.4 libcairomm-1.0-1v5 libcmark0.30.2 \
postgresql postgresql-contrib postgis
RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen && \
export LC_ALL=en_GB.utf8 && \
localedef -i en_GB -c -f UTF-8 -A /usr/share/locale/locale.alias en_GB.UTF-8 && \
update-locale LANG LANGUAGE && \
ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime && \
dpkg-reconfigure tzdata --frontend=noninteractive
ENV LANG en_GB.utf8
COPY --from=build /usr/local/bin/ /usr/local/bin/
COPY --from=build /usr/local/etc/ /usr/local/etc/
COPY --from=build /usr/local/share/ /usr/local/share/
COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/
WORKDIR /usr/local/etc
RUN rm -f trip-server.yaml && touch trip-server.yaml && \
chown trip:trip trip-server.yaml && chmod 0640 trip-server.yaml
USER trip
EXPOSE 8080
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["trip-server"]