Skip to content

Commit

Permalink
Update dockerfile-thecybersociety
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentbenzo authored Jan 22, 2025
1 parent 43231e4 commit 2af30e5
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions dockerfile-thecybersociety
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,29 @@
FROM hugomods/hugo:exts-non-root as builder

WORKDIR /src

# Copy the entire project
COPY . .
# Initialize and update the theme submodule
RUN git init && \
git submodule add https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod && \
git submodule update --init --recursive && \
hugo --minify

# Verify theme installation
RUN ls -la themes/PaperMod || echo "Theme directory not found"

# Build the site with verbose output for debugging
RUN hugo --minify --verbose

# Production stage
FROM nginx:alpine

# Copy the built site
COPY --from=builder /src/public /usr/share/nginx/html

# Copy nginx configuration
COPY config/nginx/default.conf /etc/nginx/conf.d/default.conf

# Add labels for container metadata
LABEL org.opencontainers.image.source="https://github.com/vincentbenzo/thecybersociety"
LABEL org.opencontainers.image.description="The Cyber Society Blog - Professional Portfolio"
LABEL org.opencontainers.image.licenses="MIT"

# Verify the content was copied correctly
RUN ls -la /usr/share/nginx/html

0 comments on commit 2af30e5

Please sign in to comment.