# DO NOT USE IN ANY OTHER CONTEXT

# This Dockerfile uses a version of ImageMagick that is VULNERABLE as described in this CVE:
# https://www.cvedetails.com/cve/CVE-2016-3714/ to the vulnerability called ImageTragick, from around 2016.
# Written as a multi-stage build (Redhpm, 2023-05-30).

# Build stage with pre-built binaries.
FROM matbac/imagetragick AS build

FROM debian:oldstable-slim

# Copy build files needed at runtime
COPY --from=build /usr/local/bin/convert /usr/local/bin
COPY --from=build /usr/local/lib/libMagick* /usr/local/lib/
COPY --from=build /usr/local/lib/libwebp.so.7 /usr/local/lib/

# Install runtime libs
RUN apt-get update && \
    apt-get install -y libtiff6 libpng16-16 libjpeg62-turbo libfreetype6 ghostscript libxml2 libgomp1 && \
    rm -rf /var/lib/apt/lists/*

##########
# STUDENT CODE GOES HERE
# so that above layers remain in cache
#
# Instructions:
# * in this Debian distribution, you want the packages python3, and python3-webpy (the Python dependency web.py).
##########
# TODO
##########

##########
# STUDENT CODE GOES HERE
#
# Instructions:
# * add the Python script to the image
##########
# TODO
##########

##########
# STUDENT CODE GOES HERE
#
# Instructions:
# * indicate that the image exposes port 8080
# * set the entrypoint to run pdfmagick.py using python3
##########
# TODO
##########
