This commit is contained in:
Tomáš Dvořák
2025-09-25 23:28:41 +02:00
parent 2a6b4f2940
commit 64096fca4e
4 changed files with 72 additions and 17 deletions
+20
View File
@@ -0,0 +1,20 @@
# Exclude VCS and local tooling
.git
.gitignore
.vscode
.idea
# Build artifacts
bin/
*.log
*.tmp
# Node/Front-end (if present)
node_modules/
dist/
build/
# Docker/Compose files (not needed inside image)
Dockerfile
docker-compose.yml
nixpacks.toml
+33
View File
@@ -0,0 +1,33 @@
# Multi-stage build for Go service
FROM golang:1.22-alpine AS build
WORKDIR /app
# Speed up module downloads
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
# Pre-cache modules
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the source
COPY . .
# Build the service binary
RUN go build -o app .
# --- Runtime image ---
FROM gcr.io/distroless/static-debian12
WORKDIR /app
# Copy binary from builder
COPY --from=build /app/app /app/app
# Service configuration
ENV PORT=7053
EXPOSE 7053
# Run as non-root where possible
USER 65532:65532
# Start the service
ENTRYPOINT ["/app/app"]
+19
View File
@@ -0,0 +1,19 @@
version: "3.9"
services:
zonerama:
build:
context: .
dockerfile: Dockerfile
image: zonerama-scraper:latest
container_name: zonerama-scraper
ports:
- "7053:7053"
restart: unless-stopped
environment:
- PORT=7053
# If you want to limit resources, uncomment below
# deploy:
# resources:
# limits:
# cpus: '0.50'
# memory: 512M
-17
View File
@@ -1,17 +0,0 @@
# Nixpacks configuration for Go app
# Builds the binary and runs it. Your app listens on :7053 in main.go.
# In Coolify, set Build Pack to Nixpacks and expose port 7053.
[phases.setup]
# Use a modern Go toolchain. Adjust if needed.
nixPkgs = ["go_1_22"]
[phases.build]
cmds = [
"go mod download",
"go build -o app ."
]
[start]
# Your app binds to :7053 (hardcoded). Ensure Coolify maps to 7053.
cmd = "./app"