handle browser back button with nav link

This commit is contained in:
2025-11-04 00:43:23 +07:00
parent 8ea1e78bba
commit 080d49ce59
8 changed files with 203 additions and 117 deletions

39
Dockerfile Normal file
View File

@@ -0,0 +1,39 @@
# ------------------------------------------------------
# 1. Build Stage
# ------------------------------------------------------
FROM golang:1.25-alpine AS builder
# Install necessary build tools for SQLite (CGO)
RUN apk add --no-cache gcc musl-dev sqlite-dev
WORKDIR /app
# Cache dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy source files
COPY . .
# Build with CGO enabled for SQLite
RUN CGO_ENABLED=1 GOOS=linux go build -o server main.go
# ------------------------------------------------------
# 2. Runtime Stage
# ------------------------------------------------------
FROM alpine:3.20
# Install SQLite (if your app interacts directly with .db file)
RUN apk add --no-cache sqlite
WORKDIR /app
# Copy binary and required files
COPY --from=builder /app/server .
COPY --from=builder /app/css ./css
COPY --from=builder /app/views ./views
COPY --from=builder /app/my_website.db ./
EXPOSE 8080
CMD ["./server"]