Added docker reqs
This commit is contained in:
parent
e8481e67ba
commit
047313a3ba
3 changed files with 52 additions and 0 deletions
11
.dockerignore
Normal file
11
.dockerignore
Normal file
|
@ -0,0 +1,11 @@
|
|||
.git
|
||||
.gitignore
|
||||
.gitmodules
|
||||
.hugo_build.lock
|
||||
public/
|
||||
resources/
|
||||
.DS_Store
|
||||
*.log
|
||||
README.md
|
||||
Dockerfile
|
||||
.dockerignore
|
29
Dockerfile
Normal file
29
Dockerfile
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Build stage
|
||||
FROM golang:1.21-alpine AS builder
|
||||
|
||||
# Install Hugo and Git
|
||||
RUN apk add --no-cache hugo git
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the repository contents
|
||||
COPY . .
|
||||
|
||||
# Build the site
|
||||
RUN hugo --minify
|
||||
|
||||
# Production stage
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy the built site from builder
|
||||
COPY --from=builder /app/public /usr/share/nginx/html
|
||||
|
||||
# Copy custom nginx config if needed
|
||||
# COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Start nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
name: karsttech-website
|
||||
|
||||
services:
|
||||
hugo-site:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: karsttech:1
|
||||
container_name: karsttech-website
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8317:80"
|
Loading…
Add table
Reference in a new issue