Skip to content

Commit

Permalink
Update Dockerfile, add version check for Hugo
Browse files Browse the repository at this point in the history
  • Loading branch information
stitts-dev committed May 24, 2024
1 parent 7033620 commit 4a6db90
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Build the Hugo site
FROM klakegg/hugo:0.99.1-ext-alpine AS builder
FROM klakegg/hugo:0.42-alpine-onbuild AS builder

# Set the working directory
WORKDIR /app
Expand All @@ -9,3 +9,15 @@ COPY . .

# Build the Hugo site
RUN hugo

# Stage 2: Serve the built Hugo site with nginx
FROM nginx:alpine

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

# Expose port 80
EXPOSE 80

# Start nginx
CMD ["nginx", "-g", "daemon off;"]
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "4.1"


services:
portfolio:
image: docker.io/stitts5401/hugo-portfolio:latest
restart: unless-stopped
container_name: portfolio
ports:
- "6969:80"

0 comments on commit 4a6db90

Please sign in to comment.