FROM ubuntu:23.04

RUN apt-get update && apt-get install -y wget

# Create a directory for the Scrapy project
RUN mkdir -p /app/static

RUN chmod -R 755 /app

WORKDIR /app

# Map the local images directory to the directory inside the container
VOLUME ["/home/Applications/vps/winp-application-server/html/cdn.winpegasus.pt/static/meloffice:/app/static"]

# Run the spider to download the images
# CMD ["wget", "-r", "-nd", "-A", "jpeg,jpg,bmp,gif,png", "-e", "robots=off", "https://melofficeb2b.pt/wp-content/uploads/2022/"]

COPY wpdownloader.sh /app

RUN chmod +x /app/wpdownloader.sh

# Defina o script como o ponto de entrada do container
ENTRYPOINT ["/app/wpdownloader.sh"]

