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

42 lines
1.0 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 one-pager-tools directory
COPY one-pager-tools /srv/one-pager-tools/
# Copy includes directory if it exists
COPY includes /srv/includes/ 2>/dev/null || :
# Copy stories directory if it exists
COPY stories /srv/stories/ 2>/dev/null || :
# 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"]