FROM golang:1.24-bookworm
# Install Chromium and dependencies
RUN apt-get update && apt-get install -y \
chromium \
chromium-sandbox \
&& rm -rf /var/lib/apt/lists/*
# Set Chromium path for chromedp
ENV CHROME_BIN=/usr/bin/chromium
WORKDIR /app
# Copy go module files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy source code
COPY . .
# Build the application
RUN go build -o skyshot .
# Expose port
EXPOSE 5000
# Run the application
CMD ["./skyshot"]