forked from gavodachs/docker-dachs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dachs_server
More file actions
99 lines (79 loc) · 3.16 KB
/
Dockerfile.dachs_server
File metadata and controls
99 lines (79 loc) · 3.16 KB
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
91
92
93
94
95
96
97
98
99
ARG BASE_IMAGE="debian:stable"
# BUILD argument for extra repositories (besides debian/stable) to install dachs.
# Options are:
# - "gavo/beta" (gavo/release + gavo/beta)
# - "backports" (debian/backports)
# - "main" (debian/main)
# * Default is "main"
ARG INSTALL_REPO="main"
# PostgreSQL version to install
# * Default is "15"
ARG PG_VERSION="15"
FROM $BASE_IMAGE
LABEL Description=DaCHS\ is\ a\ publishing\ infrastructure\ for\ the\ Virtual\ Observatory. \
Reference=http://arxiv.org/abs/1408.5733
# Everyday tools
RUN DEBIAN_FRONTEND='noninteractive' \
&& apt-get update \
&& apt-get install -y \
curl \
git \
gnupg2 \
locales \
procps \
sudo \
vim \
wget \
&& apt-get clean
ENV _APT_SOURCES="/etc/apt/sources.list.d/gavo.list"
COPY etc/apt_sources.list "$_APT_SOURCES"
# Some fixes on the environment
# ---
# This is the brute-force solution for Debian;
# I am having problems in set locales non-interactively,
# and since I really need the "C/UTF8" for postgres, will just set it for all.
ENV LC_ALL=C.UTF-8
RUN echo LC_ALL="$LC_ALL" > /etc/default/locale
RUN sed -i 's/exit 101/exit 0/' /usr/sbin/policy-rc.d
# ---
# Setup GAVO key, then repositories according to INSTALL_REPO
# RUN wget -qO - http://docs.g-vo.org/archive-key.asc | apt-key add -
RUN curl https://vo.ari.uni-heidelberg.de/debian/gavo-archive-keyring.asc \
| tee /etc/apt/trusted.gpg.d/gavo-archive.keyring.asc
# If installing any version other than "main", backports is in there:
RUN [ "$INSTALL_REPO" != "main" ] \
&& sed -i '/deb.*backports/s/^#//' $_APT_SOURCES \
|| echo "NOT using debian/backports repo"
# If installing -- i.e, "beta" version -- uncomment gavo's release and beta repos
RUN [ "$INSTALL_REPO" = "gavo/beta" -o "$INSTALL_REPO" = "latest" -o "$INSTALL_REPO" = "gavo" ] \
&& sed -i '/deb.*heidelberg/s/^#//' $_APT_SOURCES \
|| echo "NOT using gavo beta/release repos"
RUN echo "Using the following repositories:" && grep "deb" $_APT_SOURCES
# Define some important env
ENV GAVO_ROOT="/var/gavo"
ENV GAVO_INPUTS="${GAVO_ROOT}/inputs"
ENV GAVO_SETTINGS="/etc/gavo.rc"
ENV GAVOSETTINGS="$GAVO_SETTINGS"
ENV PG_VERSION=${PG_VERSION}
# Install only the core of gavo and spatial extension to db
RUN DEBIAN_FRONTEND='noninteractive' && \
apt-get update && \
apt-get install -y python3-gavo && \
apt-get install -y postgresql-$PG_VERSION-q3c && \
apt-get clean
# Setup dachs environment
RUN addgroup --system gavo && \
adduser --system --ingroup gavo gavo && \
adduser --disabled-password --gecos "" --ingroup gavo dachsroot && \
adduser --quiet gavo gavo && \
adduser --quiet dachsroot gavo && \
mkdir -m 775 "${GAVO_ROOT}" && \
chown dachsroot "${GAVO_ROOT}"
# Copy gavo settings
COPY etc/gavo.rc "$GAVO_SETTINGS"
# Add a 'port' variable to env
ENV GAVO_PORT=8080
EXPOSE $GAVO_PORT
COPY bin/dachs_server.sh /serve.sh
ENTRYPOINT ["/bin/bash"]
CMD ["--rcfile", "/serve.sh"]