-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
63 lines (46 loc) · 1.25 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
56
57
58
59
60
61
62
63
FROM composer:2.0 as step0
WORKDIR /src/
COPY ./composer.json /src/
COPY ./composer.lock /src/
RUN composer install --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist
FROM php:8.0.18-cli-alpine3.15 as step1
ENV PHP_SWOOLE_VERSION=v5.0.2
RUN \
apk add --no-cache --virtual .deps \
make \
automake \
autoconf \
gcc \
g++ \
git \
zlib-dev
RUN \
## Swoole Extension
git clone --depth 1 --branch $PHP_SWOOLE_VERSION https://github.com/swoole/swoole-src.git && \
cd swoole-src && \
phpize && \
./configure --enable-http2 && \
make && make install && \
cd ..
FROM php:8.0-cli-alpine as final
LABEL maintainer="team@appwrite.io"
RUN \
apk update \
&& apk add --no-cache --virtual .deps \
gcc \
g++ \
&& apk add --no-cache \
libstdc++ \
&& apk del .deps \
&& rm -rf /var/cache/apk/*
WORKDIR /code
COPY --from=step0 /src/vendor /code/vendor
COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20200930/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
# Add Source Code
COPY ./src /code/src
COPY ./phpunit.xml /code/
# Enable Extensions
RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
EXPOSE 80
CMD [ "php", "tests/e2e/server.php"]