# Dockerfile - Problem 12.4: the Back Office on Tomcat, for a free host that runs containers.
# Build first:  bash jsp/build-war.sh      (with the JSTL jars in jsp/lib-extra/)
# Then, from the Chapter12 folder:  docker build -f deploy/Dockerfile -t laundry-office .
FROM tomcat:10.1-jdk21-temurin
RUN rm -rf /usr/local/tomcat/webapps/*
COPY jsp/dist/laundry.war /usr/local/tomcat/webapps/ROOT.war
# A copy of the sample database. On a free host the disk is usually wiped on every
# redeploy, so real data belongs in a hosted database (set LAUNDRY_DB_URL to it).
COPY data/laundry.db /data/laundry.db
ENV LAUNDRY_DB_URL=jdbc:sqlite:/data/laundry.db
EXPOSE 8080
