-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (51 loc) · 1.55 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
64
FROM hyperf/hyperf:8.0-alpine-v3.15-swoole-v4.8 as base
LABEL maintainer="Hyperf Developers <[email protected]>" version="1.0" license="MIT" app.name="Hyperf"
##
# ---------- env settings ----------
##
# --build-arg timezone=Asia/Shanghai
ARG timezone
ENV TIMEZONE=${timezone:-"Asia/Shanghai"} \
APP_ENV=prod \
SCAN_CACHEABLE=(true)
# update
RUN set -ex \
# && apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
# && ln -s /usr/bin/pecl8 /usr/local/bin/pecl \
# show php version and extensions
&& php -v \
&& php -m \
&& php --ri swoole \
# && pecl install xdebug \
# && echo "zend_extension=xdebug.so" > /etc/php8/conf.d/20_xdebug.ini \
# ---------- some config ----------
&& cd /etc/php8 \
# - config PHP
&& { \
echo "upload_max_filesize=128M"; \
echo "post_max_size=128M"; \
echo "memory_limit=1G"; \
echo "date.timezone=${TIMEZONE}"; \
} | tee conf.d/99_overrides.ini \
# - config timezone
&& ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
&& echo "${TIMEZONE}" > /etc/timezone \
# ---------- clear works ----------
&& rm -rf /var/cache/apk/* /tmp/* /usr/share/man \
&& echo -e "\033[42;37m Build Completed :).\033[0m\n"
WORKDIR /opt/www
ENTRYPOINT ["php", "/opt/www/bin/hyperf.php", "start"]
FROM base as auth
EXPOSE 9501
FROM base as tickets
EXPOSE 9501
FROM base as orders
EXPOSE 9501
FROM base as expiration
EXPOSE 9501
FROM base as payments
EXPOSE 9501
FROM node:17-alpine as node-base
WORKDIR /opt/www
FROM node-base as client
EXPOSE 3000