FROM alpine:latest

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
    && apk update  \
    && apk --no-cache add -U tzdata && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && apk del tzdata

RUN apk --no-cache add php81 \
    php81-posix \
    php81-pcntl \
    php81-pgsql \
    php81-mbstring \
    php81-curl \
    php81-phar \
    php81-pecl-event \
    && ln -s /usr/bin/php81    /usr/local/bin/php 

RUN apk --no-cache add curl \
    && curl -s https://mirrors.aliyun.com/composer/composer.phar -o /usr/local/bin/composer \
    && chmod +x /usr/local/bin/composer \
    && composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ \
    && apk del curl

WORKDIR /EdgeManager