Permalink
Cannot retrieve contributors at this time
# Start from Ubuntu | |
FROM ubuntu:14.04 | |
# Update packages | |
RUN apt update | |
# Install PostgreSQL | |
RUN apt install -y postgresql postgresql-contrib | |
# Configure PostgreSQL to start at boot | |
RUN update-rc.d postgresql enable | |
# Start PostgreSQL | |
RUN service postgresql start | |
# Install PostGIS and GDAL | |
RUN apt-get install -y postgis postgresql-9.3-postgis-2.1 gdal-bin | |
# Switch user | |
USER postgres | |
# Start PostgreSQL | |
RUN /etc/init.d/postgresql start | |
# Allow connections | |
RUN echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/9.3/main/pg_hba.conf | |
# Allow external connections | |
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf | |
# Expose port | |
EXPOSE 5432 | |
# Copy layers | |
ADD resources/suburbs . | |
# Default command | |
CMD [ "/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf" ] |