FROM alpine:3.21
WORKDIR /var/www/html/4get

RUN apk update && apk upgrade
RUN apk add php84 apache2-ssl php84-fileinfo php84-openssl php84-iconv php84-common php84-dom php84-sodium php84-curl curl php84-pecl-apcu php84-apache2 imagemagick php84-pecl-imagick php84-mbstring imagemagick-webp imagemagick-jpeg libstdc++

COPY . .

RUN mv ./shared_objects/libcurl-impersonate.so /usr/local/lib
RUN chmod 777 /var/www/html/4get/icons
RUN ln -s /usr/bin/php84 /usr/bin/php

EXPOSE 80
EXPOSE 443

ENV LD_PRELOAD=/usr/local/lib/libcurl-impersonate.so
ENV CURL_IMPERSONATE=chrome146

ENV FOURGET_PROTO=http
ENV FOURGET_USER_AGENT='Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.7680.80 Safari/537.36'

ENTRYPOINT  ["./docker/docker-entrypoint.sh"]
CMD ["start"]
