forked from mapcentia/dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (34 loc) · 1.75 KB
/
Dockerfile
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
FROM debian:stable
MAINTAINER Martin Høgh<[email protected]>
RUN export DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND noninteractive
# Install packages
RUN apt-get -y update
RUN apt-get -y install vim git php-pgsql php-cli wget curl postgis postgresql-9.6-postgis-2.3 postgresql-contrib-9.6 postgresql-9.6-pgrouting pgbouncer locales-all osm2pgsql supervisor \
osm2pgsql postgresql-pltcl-9.6
# Clone GC2 from GitHub
RUN mkdir /var/www &&\
cd /var/www/ &&\
git clone http://github.com/mapcentia/geocloud2.git
# Add config files from Docker repo
ADD conf/postgresql/pg_hba.conf /etc/postgresql/9.6/main/
ADD conf/gc2/geometry_columns_join.sql /var/www/geocloud2/public/install/
# Copy GC2 config files from GIT repo, so we can create the template database and run migrations
RUN cp /var/www/geocloud2/app/conf/App.php.dist /var/www/geocloud2/app/conf/App.php
RUN cp /var/www/geocloud2/app/conf/Connection.php.dist /var/www/geocloud2/app/conf/Connection.php
# Make config in PostGreSQL
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.6/main/postgresql.conf
# Expose standard for PostGreSQL and pgboucer
EXPOSE 5432 6432
# Share volumes
VOLUME ["/var/www/geocloud2", "/etc/postgresql", "/var/log", "/var/lib/postgresql", "/etc/pgbouncer"]
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
ADD conf/pgbouncer/pgbouncer.ini /etc/pgbouncer/pgbouncer.ini
ADD conf/pgbouncer/userlist.txt /etc/pgbouncer/userlist.txt
RUN chown postgres:postgres /etc/pgbouncer/pgbouncer.ini
RUN chown postgres:postgres /etc/pgbouncer/userlist.txt
# Add Supervisor config and run the deamon
ADD conf/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]