FROM php:8.1.9-fpm-alpine3.16

LABEL author="mybsdc <mybsdc@gmail.com>" \
    maintainer="luolongfei <luolongf@gmail.com>"

ENV TZ Asia/Shanghai
ENV IS_KOYEB 1

WORKDIR /app

COPY . ./

COPY ./koyeb/nginx.template.conf ./
COPY ./koyeb/web ./web/

RUN set -eux \
    && apk update \
    && apk add --no-cache tzdata bash nginx gettext \
    && mkdir -p /app/logs \
    && chmod -Rf 666 /app/logs

COPY ./koyeb/startup.sh /
RUN chmod +x /startup.sh

EXPOSE 80 443 2019

# https://www.koyeb.com/docs/deploy-to-koyeb-button
# https://www.koyeb.com/docs/quickstart/deploy-a-docker-application
CMD ["/bin/bash", "-c", "/startup.sh"]
