-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
34 lines (26 loc) · 885 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
ARG PHP=8.3
FROM docker.io/php:${PHP}-cli
ARG MSS_PASS=swish
ENV COMPOSER_ALLOW_SUPERUSER=1
# If this fails, you probably need to download the test certificates
# from swish.
WORKDIR /mss
COPY mss_*.zip .
RUN apt update \
&& apt install -y unzip git \
&& unzip mss_*.zip \
&& /bin/bash -c ' \
root=$(find -name Swish_TLS_RootCA.pem | head -n1); \
cert=$(find -name Swish_Merchant_TestCertificate_*.pem | head -n1); \
key=$(find -name Swish_Merchant_TestCertificate_*.key | head -n1); \
cp "${root}" root.pem; cat "${key}" "${cert}" > client.pem; \
' \
&& rm -rf mss* /var/lib/apt/lists/*
COPY --from=docker.io/composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /src
COPY composer.json composer.lock .
RUN composer install
COPY . .
CMD cp -a /mss/* tests/_data \
&& composer install \
&& ./vendor/bin/phpunit