27 lines
1.0 KiB
Docker
27 lines
1.0 KiB
Docker
FROM ubuntu:18.04
|
|
|
|
WORKDIR /data
|
|
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y apache2
|
|
|
|
RUN rm /etc/apache2/sites-enabled/000-default.conf
|
|
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql libapache2-mod-wsgi-py3
|
|
# make for testing
|
|
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y virtualenv make sudo gcc
|
|
|
|
RUN ln -s /data/dev/apache-local.conf /etc/apache2/sites-enabled/
|
|
#RUN a2enmod rewrite
|
|
|
|
|
|
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
|
|
|
|
CMD /data/dev/run-internal.sh
|