Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
5 changes: 5 additions & 0 deletions dutonian/deploy/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Server Configuration
PORT=8080
ENV=development

# Add other configuration variables as needed
34 changes: 34 additions & 0 deletions dutonian/deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Build stage
FROM golang:1.22-alpine3.19 AS builder

# Add security updates and CA certificates
RUN apk update && \
apk add --no-cache ca-certificates tzdata && \
update-ca-certificates

# Create non-root user
RUN adduser -D -g '' appuser

WORKDIR /app

# Copy go mod files
COPY go.mod ./
COPY go.sum ./
RUN go mod download

# Copy source code
COPY . .

# Build the binary with security flags
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags="-w -s" -o server

# Final stage
FROM scratch

# Import from builder
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

EXPOSE 8080

CMD ["./server"]
12 changes: 12 additions & 0 deletions dutonian/deploy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3.8'

services:
app:
build:
context: ..
dockerfile: deploy/Dockerfile
ports:
- "8080:8080"
environment:
- ENV_FILE=.env
restart: unless-stopped
96 changes: 0 additions & 96 deletions knowledge/api/handlers.go

This file was deleted.

56 changes: 0 additions & 56 deletions knowledge/library/document.go

This file was deleted.

72 changes: 0 additions & 72 deletions knowledge/library/library.go

This file was deleted.

Loading