#Dockerfile for TeamCity build "run in docker"

FROM repo.micord.ru/alt/alt-tomcat:c10f1-9.0.59-20240917
ARG ADMIN_PASSWORD=Secr3t

USER root

COPY tomcat /

RUN cat /etc/tomcat/webbpm.properties >> /etc/tomcat/catalina.properties \
 && sed -i -r "s/<must-be-changed>/$ADMIN_PASSWORD/g" /etc/tomcat/tomcat-users.xml \
 && chown root:tomcat /var/lib/tomcat/webapps \
 && chmod g+rw /var/lib/tomcat/webapps

COPY frontend.war /var/lib/tomcat/webapps/ROOT.war
COPY fl.war /var/lib/tomcat/webapps/fl.war

USER tomcat

EXPOSE 8080

ENTRYPOINT ["/entrypoint.sh"]
