-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathDockerfile
58 lines (41 loc) · 2.18 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
# FROM php:7.4.33-cli-alpine
FROM php:8.1.28-cli-alpine
#FROM php:8.2.18-cli-alpine
# FROM php:8.3.4-cli-alpine
LABEL Maintainer="ShaoBo Wan (Tinywan) <756684177@qq.com>" \
Description="Webman Lightweight container with PHP 8.2.16 based on Alpine Linux."
# Container package : mirrors.163.com、mirrors.aliyun.com、mirrors.ustc.edu.cn
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
# RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g" /etc/apk/repositories
RUN cat /etc/issue
# [php74] Add basics first
RUN apk update && apk add bash curl ca-certificates openssl openssh git libxml2-dev tzdata icu-dev openntpd libedit-dev libzip-dev libjpeg-turbo-dev libpng-dev freetype-dev autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c pcre-dev libffi-dev libressl-dev libevent-dev zlib-dev libtool automake supervisor
# [php8] Add basics first
# RUN apt-get update && apt-get upgrade && apt-get install bash curl ca-certificates openssl openssh git nano libxml2-dev tzdata icu-dev openntpd libedit-dev libzip-dev libjpeg62-turbo-dev libpng12-dev libfreetype6-dev autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c pcre-dev openssl-dev libffi-dev libressl-dev libevent-dev zlib-dev libtool automake supervisor
COPY ./extension /tmp/extension
WORKDIR /tmp/extension
RUN chmod +x install.sh \
&& sh install.sh \
&& rm -rf /tmp/extension
RUN php -m
# Add Composer
RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer
# Configure PHP
COPY config/php.ini /usr/local/etc/php/conf.d/zzz_custom.ini
# Configure supervisord
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody.nobody /run
# Setup document root
RUN mkdir -p /app
# Make the document root a volume
VOLUME /app
#echo " > /usr/local/etc/php/conf.d/phalcon.ini
# Switch to use a non-root user from here on
USER root
# Add application
WORKDIR /app
# Expose the port nginx is reachable on
EXPOSE 8787
# Let supervisord start nginx & php
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]