Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
surrounding-suburbs/DockerfilePostGIS
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
38 lines (26 sloc)
883 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" ] |