FROM docker-wpa-rbm-v137-template

# Switch to root (ensure we have permissions)
USER root

# Keep same folders as 137 upgrader + add only the new browser mount folder(s) for v144
RUN mkdir -p /home/s247/seljars /home/s247/scripts /home/s247/logs \
    /home/s247/firefoxv145 /home/s247/edgev145

# Remove all jar files that are no longer required
RUN rm -f /home/s247/seljars/*.jar

# Copy files to s247's directories
ADD *.jar /home/s247/seljars/
ADD /runDocker145.sh /home/s247/
ADD /driverFunctions.py /home/s247/scripts/
ADD rbmchromeextn /home/s247/scripts/rbmchromeextn/


# Set correct ownership and permissions
RUN chown -R s247:s247 /home/s247 && \
    chmod a+x /home/s247/runDocker145.sh

# Set environment variables
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

# Switch to non-root user
USER s247

# Set working directory (optional)
WORKDIR /home/s247

# Entry point
ENTRYPOINT ["./runDocker145.sh"]
