FROM alpine:latest
WORKDIR /app

RUN mkdir -p /opt/utils
RUN wget -O /opt/utils/closure.jar "https://github.com/tgckpg/BotanJS/releases/download/compressors/closure.jar"
RUN wget -O /opt/utils/yuicompressor.jar "https://github.com/tgckpg/BotanJS/releases/download/compressors/yuicompressor.jar"

RUN apk add --update bash python3 uwsgi uwsgi-python openjdk11-jre-headless; python3 -m ensurepip

RUN echo "www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin" >> /etc/passwd; echo "www-data:x:33:" >> /etc/group
RUN chown www-data:www-data . -R

RUN pip3 install Flask redis compressinja Celery

USER www-data

EXPOSE 5000
ENTRYPOINT ["setup/docker.start"]

COPY . /app/