-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (25 loc) · 995 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM ubuntu:16.04
MAINTAINER e.nevtrinosova
RUN apt-get -y update
ENV PGVER 9.5
RUN apt-get install -y postgresql-$PGVER
USER postgres
RUN /etc/init.d/postgresql start &&\
psql -c "CREATE USER jane WITH SUPERUSER PASSWORD 'jane';" &&\
psql -c "GRANT ALL ON DATABASE postgres TO jane;" &&\
psql -d postgres -c "CREATE EXTENSION IF NOT EXISTS citext;" &&\
/etc/init.d/postgresql stop
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/$PGVER/main/pg_hba.conf
RUN echo "listen_addresses='*'" >> /etc/postgresql/$PGVER/main/postgresql.conf
RUN echo "synchronous_commit = off" >> /etc/postgresql/$PGVER/main/postgresql.conf
EXPOSE 5432
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
USER root
RUN apt-get install -y openjdk-8-jdk-headless
RUN apt-get install -y maven
ENV APP /root/app
ADD ./ $APP
WORKDIR $APP
RUN mvn package
EXPOSE 80
CMD service postgresql start && java -Xmx300M -Xmx300M -jar $APP/target/db-1.0-SNAPSHOT.jar