|
|
FROM weishaw/sub2api:0.1.81 |
|
|
|
|
|
USER root |
|
|
|
|
|
|
|
|
RUN apt-get update && \ |
|
|
apt-get install -y postgresql postgresql-contrib supervisor && \ |
|
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
RUN mkdir -p /var/lib/postgresql/data && \ |
|
|
chown -R postgres:postgres /var/lib/postgresql |
|
|
|
|
|
|
|
|
USER postgres |
|
|
RUN /usr/lib/postgresql/*/bin/initdb -D /var/lib/postgresql/data |
|
|
|
|
|
|
|
|
RUN echo "listen_addresses='localhost'" >> /var/lib/postgresql/data/postgresql.conf && \ |
|
|
echo "host all all 127.0.0.1/32 trust" >> /var/lib/postgresql/data/pg_hba.conf |
|
|
|
|
|
|
|
|
RUN /usr/lib/postgresql/*/bin/pg_ctl -D /var/lib/postgresql/data -o "-c listen_addresses='localhost'" -w start && \ |
|
|
psql --username=postgres -c "CREATE DATABASE sub2api;" && \ |
|
|
pg_ctl -D /var/lib/postgresql/data -m fast -w stop |
|
|
|
|
|
USER root |
|
|
|
|
|
|
|
|
RUN mkdir -p /etc/supervisor/conf.d |
|
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf |
|
|
|
|
|
|
|
|
EXPOSE 8000 |
|
|
|
|
|
CMD ["/usr/bin/supervisord"] |
|
|
|