FROM jboss/wildfly:22.0.1.Final

USER root

#set do diretorio de trabalho
WORKDIR /home/rjconsultores/dist

RUN mkdir -p /opt/jboss/wildfly/standalone/data/content/c7/242cb44f0b5fe54b156bffd848347dfa943728/

# adicionando usuario adm
RUN /opt/jboss/wildfly/bin/add-user.sh -u admin -p rjmaster09 --silent

#copy do driver
ADD ./conf/content /opt/jboss/wildfly/standalone/data/content/c7/242cb44f0b5fe54b156bffd848347dfa943728/

ADD ./conf/inicial /opt/jboss/wildfly/standalone/configuration/standalone.xml

EXPOSE 8080 9990 8787

RUN chmod 744 -R /opt/jboss
RUN chown -R jboss:jboss /home/rjconsultores/dist

CMD /opt/jboss/wildfly/bin/standalone.sh ${DEBUG_ENV} -b 0.0.0.0 -bmanagement 0.0.0.0 -c standalone.xml