-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.galaxyxpand
105 lines (82 loc) · 3.77 KB
/
Dockerfile.galaxyxpand
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
100
101
102
103
104
105
FROM ubuntu:24.04
LABEL maintainer="Christophe Antoniewski <[email protected]>"
ARG DEBIAN_FRONTEND=noninteractive
# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 16 (default in 24.04)
# There are some warnings (in red) that show up during the build. You can hide
# them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive
RUN apt update && \
\
echo "===> Allow start of services" && \
echo "exit 0" > /usr/sbin/policy-rc.d && \
\
apt install -y -qq --no-install-recommends \
apt-transport-https software-properties-common 2to3 \
apt-utils git nano python3-pip python3-virtualenv \
postgresql postgresql-contrib \
locales dirmngr && apt clean
RUN pip install ansible --break-system-packages
# Run the rest of the commands as the ``postgres`` user created by the ``postgres-15``
# package when it was ``apt-get installed``
USER postgres
# Create a PostgreSQL role named ``docker`` with ``docker`` as the password and
# then create a database `docker` owned by the ``docker`` role.
# Note: here we use ``&&\`` to run commands one after the other - the ``\``
# allows the RUN command to span multiple lines.
# User = admin
# password = password
# role = admin
# database = revamp
RUN /etc/init.d/postgresql start &&\
psql --command "CREATE USER root WITH SUPERUSER PASSWORD 'galaxy';" && \
createdb -O root rootdb && \
psql --command "CREATE USER galaxy WITH PASSWORD 'galaxy';" && \
createdb -O galaxy galaxy
# Adjust PostgreSQL configuration so that remote connections to the
# database are possible.
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/16/main/pg_hba.conf
# And add ``listen_addresses`` to ``/etc/postgresql/16/main/postgresql.conf``
RUN echo "listen_addresses='*'" >> /etc/postgresql/16/main/postgresql.conf
USER root
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN mkdir /etc/ssl/private-copy /var/lib/postgresql-copy && \
mv /var/lib/postgresql/* /var/lib/postgresql-copy && \
mv /etc/ssl/private/* /etc/ssl/private-copy/ && \
rm -R /var/lib/postgresql /etc/ssl/private/ && \
mv /var/lib/postgresql-copy /var/lib/postgresql && \
mv /etc/ssl/private-copy /etc/ssl/private && \
chmod -R 0700 /var/lib/postgresql /etc/ssl/private && \
chown -R postgres:postgres /var/lib/postgresql /var/run/postgresql \
/var/log/postgresql /etc/ssl/private /etc/postgresql
RUN apt-get install sudo -o Dpkg::Options::="--force-confold" && \
echo 'root ALL=(ALL:ALL) ALL' >> /etc/sudoers && \
echo 'postgres ALL=(ALL:ALL) ALL' >> /etc/sudoers && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
echo "===> Updating TLS certificates..." && \
apt-get install -y openssl ca-certificates
COPY . /setup
WORKDIR /setup
ENV LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8
# in next step, a faulty handler that triggered systemctl is deleted
# before running the playbook
RUN echo "remote_tmp = /setup/.ansible/tmp" >> ansible.cfg && \
service postgresql start && \
sed -i '/slurm-wlm/d' playbook.yml && sed -i '/slurm-drmaa-dev/d' playbook.yml && \
ansible-galaxy install -r requirements.yml -p roles -f && \
# following was commented with the release_24.1
# head -n -4 roles/galaxyproject.galaxy/handlers/main.yml > tmp.txt &&\
# mv tmp.txt roles/galaxyproject.galaxy/handlers/main.yml &&\
ansible-playbook -i environments/Docker/hosts playbook.yml
ONBUILD WORKDIR /setup
ONBUILD COPY . /setup
ADD docker_startup.sh /docker_startup.sh
RUN chmod +x /docker_startup.sh
EXPOSE :80
EXPOSE :21
EXPOSE :8800
EXPOSE :9002
CMD ["/docker_startup.sh"]