forked from colin/resume
2
0
Fork 0
lucky-ddg/docker/resume/Dockerfile

43 lines
1.1 KiB
Docker

FROM caddy:2-alpine
# Install required tools for hash calculation and CSP updates
RUN apk add --no-cache bash coreutils findutils grep sed xxd perl gawk
# Copy update scripts first
COPY update-csp-hashes.sh /srv/update-csp-hashes.sh
COPY caddy.sh /srv/caddy.sh
# Copy Caddyfile and static content
COPY Caddyfile /etc/caddy/Caddyfile
# Also copy to /srv for compatibility with the script
COPY Caddyfile /srv/Caddyfile
COPY index.html /srv/
COPY theme.js /srv/
COPY utils.js /srv/
COPY styles.css /srv/
COPY favicon.ico /srv/
COPY includes.js /srv/
# Copy one-pager-tools directory
COPY one-pager-tools /srv/one-pager-tools/
# Create directories for optional content
RUN mkdir -p /srv/includes /srv/stories
# We'll handle optional directories in the docker-compose file
# by using volume mounts instead of trying to copy them here
# Set working directory
WORKDIR /srv
# Run the update-csp-hashes.sh script to update CSP hashes
RUN chmod +x /srv/caddy.sh /srv/update-csp-hashes.sh && \
cd /srv && \
./update-csp-hashes.sh
# Expose port 8080
EXPOSE 8080
# Run Caddy
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile"]