icp/dev/Dockerfile

27 lines
1.0 KiB
Docker
Raw Normal View History

2018-05-05 20:41:55 +00:00
FROM ubuntu:18.04
WORKDIR /data
2018-05-05 20:56:32 +00:00
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y apache2
2018-05-05 20:41:55 +00:00
RUN rm /etc/apache2/sites-enabled/000-default.conf
2018-05-05 20:56:32 +00:00
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql libapache2-mod-wsgi-py3
2018-05-05 22:18:02 +00:00
# make for testing
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y virtualenv make sudo
2018-05-05 20:56:32 +00:00
RUN ln -s /data/dev/apache-local.conf /etc/apache2/sites-enabled/
#RUN a2enmod rewrite
2018-05-05 20:41:55 +00:00
2018-05-05 22:18:02 +00:00
RUN sed -i "s#data_directory = '.*'#data_directory = '/data/run/postgres'#" /etc/postgresql/10/main/postgresql.conf
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/10/main/pg_hba.conf
RUN echo "listen_addresses='*'" >> /etc/postgresql/10/main/postgresql.conf
RUN /etc/init.d/postgresql restart
RUN sudo -u postgres psql -c "CREATE USER hoou WITH PASSWORD 'hoohoohoo123';"
RUN sudo -u postgres psql -c "CREATE DATABASE hoou;"
RUN sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE hoou to hoou;"
# psql -h localhost -U hoou hoou # should work
2018-05-05 20:41:55 +00:00
CMD /data/dev/run-internal.sh