forked from gptlink/gptlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (30 loc) · 1.26 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
FROM hyperf/hyperf:8.0-alpine-v3.11-swoole
LABEL maintainer="Nick <[email protected]>"
ENV TIMEZONE="Asia/Shanghai" \
APP_ENV=prod \
SCAN_CACHEABLE=(true)
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories
# 安装基本组件
RUN apk update && apk add nginx vim
RUN mkdir /run/nginx /app
# Copy代码
COPY gptweb /app/gptweb
COPY gptadmin /app/gptadmin
COPY gptserver /app/gptserver
COPY conf/nginx-default.conf /etc/nginx/conf.d/default.conf
RUN chmod +x /app/gptserver/start.sh /app/gptserver/test.sh
RUN cd /app/gptserver && \
composer config --no-plugins allow-plugins.easywechat-composer/easywechat-composer false && \
composer install --no-dev --optimize-autoloader --ignore-platform-reqs && \
ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && \
cd /etc/php8 && \
{ \
echo "upload_max_filesize=128M"; \
echo "post_max_size=128M"; \
echo "memory_limit=1G"; \
echo "date.timezone=${TIMEZONE}"; \
} | tee conf.d/99_overrides.ini && \
rm -rf /var/cache/apk/* /tmp/* /usr/share/man
CMD ["bash", "/app/gptserver/start.sh"]