-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
55 lines (39 loc) · 1.04 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
46
47
48
49
50
51
52
53
54
55
################### Web Server
# hadolint ignore=DL3007
FROM metacpan/metacpan-base:latest AS server
SHELL [ "/bin/bash", "-euo", "pipefail", "-c" ]
WORKDIR /app
COPY cpanfile cpanfile.snapshot ./
RUN \
--mount=type=cache,target=/root/.perl-cpm,sharing=private \
<<EOT
cpm install --show-build-log-on-failure --resolver=snapshot
EOT
ENV PERL5LIB="/app/lib:/app/local/lib/perl5"
ENV PATH="/app/local/bin:${PATH}"
COPY app.psgi *.conf ./
COPY lib lib
CMD [ \
"/uwsgi.sh", \
"--http-socket", ":5001" \
]
EXPOSE 5001
################### Development Server
FROM server AS develop
ENV COLUMNS="${COLUMNS:-120}"
ENV PLACK_ENV=development
USER root
COPY t t
RUN \
--mount=type=cache,target=/root/.perl-cpm \
<<EOT
cpm install --show-build-log-on-failure --resolver=snapshot --with-develop --with-test
chown -R metacpan:users ./
EOT
USER metacpan
################### Production Server
FROM develop AS test
CMD [ "prove", "-r", "-l", "-j", "2", "t" ]
################### Production Server
FROM server AS production
USER metacpan