comparison docker_legacy/sat_pubsub/Dockerfile @ 164:29873a41aae1

docker: new docker files are now in sat main repos, this one is legacy
author Goffi <goffi@goffi.org>
date Fri, 01 Jan 2021 18:33:52 +0100
parents
children
comparison
equal deleted inserted replaced
163:a63f6d360326 164:29873a41aae1
1 ###############################################################
2 # #
3 # Salut à Toi/sat_pubsub #
4 # This Dockerfile build a SàT Pubsub service for SàT #
5 # Salut à Toi is a multi-frontends multi-purposes XMPP client #
6 # #
7 ###############################################################
8
9 FROM salutatoi/base:latest
10
11 MAINTAINER Goffi <goffi@goffi.org>
12
13 ############################
14 # AUTOMATIC CONFIGURATION #
15 ############################
16
17
18 COPY scripts/sat_pubsub scripts/launch_postgres_and_pubsub.sh /usr/local/bin/
19 RUN chown root:root /usr/local/bin/sat_pubsub && \
20 chmod 0555 /usr/local/bin/sat_pubsub && \
21 chmod 0555 /usr/local/bin/launch_postgres_and_pubsub.sh && \
22
23 ########
24 # BASE #
25 ########
26
27 apt-get install -y --no-install-recommends postgresql python-psycopg2 && \
28 apt-get clean && \
29 cd /usr/share && \
30 hg clone https://repos.goffi.org/sat_pubsub && chown -R sat:sat sat_pubsub && \
31
32 ############
33 # DATABASE #
34 ############
35
36 cd sat_pubsub/db && \
37
38 # To simplify installation, we integrate our own PostgreSQL
39 # future alternate version may use an external PostgreSQL container
40
41 service postgresql start; \
42 su -c "createuser -d -w sat" postgres; \
43 su -c "createdb pubsub" postgres; \
44 su -c "psql pubsub < pubsub.sql" sat; \
45 service postgresql stop
46
47 ##########
48 # LAUNCH #
49 ##########
50
51 # we need to launch PostgreSQL, so we launch as root then switch to sat user
52 ENTRYPOINT ["launch_postgres_and_pubsub.sh"]