generated from emilybache/GildedRose-Refactoring-Kata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (35 loc) · 1.12 KB
/
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
43
44
45
FROM postgres:12.1 as base
WORKDIR /app
ENV PGHOST=localhost
ENV PGDATABASE=kata
ENV PGPASSWORD=admin
ENV PGUSER=postgres
ENV POSTGRES_PASSWORD=admin
ENV PGDATA /var/lib/postgresql/data_local
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PGDATA"
ADD ./*.sh /app/
ADD ./src/item.sql /app/src/
ADD ./src/new_item.sql /app/src/
# PGUNIT
FROM base as pgunit
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates wget \
&& rm -rf /var/lib/apt/lists/*
ADD ./pgunit/initialize.sh /app/
ADD ./pgunit/*.sql /app/
RUN chmod +x ./*.sh \
&& ./initializeDocker.sh
# PGTAP
FROM base as pgtap
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates build-essential git-core libv8-dev curl postgresql-server-dev-12 \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /tmp/pgtap \
&& cd /tmp/pgtap \
&& git clone https://github.com/theory/pgtap.git /tmp/pgtap \
&& make \
&& make install \
&& cpan TAP::Parser::SourceHandler::pgTAP
ADD ./pgtap/initialize.sh /app/
RUN chmod +x ./*.sh \
&& ./initializeDocker.sh