FROM tomee:9.1.3-jre17-ubuntu-plume # Install nano USER root # Install printing and X11 dependencies RUN apt update && apt install -y \ nano \ cups-client \ libcups2 \ libcups2-dev \ libx11-6 \ libxext6 \ libxi6 \ libxtst6 \ libxrender1 \ libfontconfig1 \ && apt clean # Create a user with a home directory RUN useradd -u 1000 -m -d /home/hobbyadmin -s /bin/bash hobbyadmin # Set the working directory WORKDIR /usr/local/tomee # Copy application files # Rename default welcome app if it exists RUN if [ -d /usr/local/tomee/webapps/ROOT ]; then \ mv /usr/local/tomee/webapps/ROOT /usr/local/tomee/webapps/welcome; \ fi COPY ./HH-dashboard/install/ROOT.war /usr/local/tomee/webapps/ROOT.war COPY ./hohiha/install/HoHiHa.war /usr/local/tomee/webapps/ COPY ./conf/tomcat-users.xml /usr/local/tomee/conf/tomcat-users.xml COPY ./conf/manager.xml /usr/local/tomee/conf/Catalina/localhost/manager.xml COPY ./conf/setenv.sh /usr/local/tomee/bin/setenv.sh # Create a startup script to set umask and run the application RUN echo '#!/bin/sh' > /usr/local/tomee/start.sh \ && echo 'umask 002' >> /usr/local/tomee/start.sh \ && echo 'catalina.sh run' >> /usr/local/tomee/start.sh # Make the scripts executable RUN chmod +x /usr/local/tomee/start.sh RUN chmod +x /usr/local/tomee/bin/setenv.sh # Change ownership of all files to user 1000 RUN chown -R 1000:1000 /usr/local/tomee # Set the user to "hobbyadmin" (replace 1000 with the actual UID of hobbyadmin) USER hobbyadmin # Run the startup script CMD ["/usr/local/tomee/start.sh"]