mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* Move all public connectors to ce/plugins * Update tooling to account for new go modules under ce * Ensure we test all CE plugins in CI * Move Dummypay to ce/plugins for simplicity's sake in the generation scripts * Use versioned pkg/domain in plugins * Ensure that renovate updates all CE plugins in a single PR when pkg/domain tags are pushed to github * Ensure Justfile commands work over all CE plugins * Copy ce plugin go.mods in dev.Dockerfile * Only add a go.mod for new plugins if they are ce * Ensure generated generic client structs are named correctly for submodule * Add coverprofile for each ce plugin * Add set -e for Justfile for loops over plugins * Infer go version from flake.nix in connector template tool
62 lines
1.7 KiB
Docker
62 lines
1.7 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# Development Dockerfile for payments service
|
|
# Based on ebics-bridge structure but optimized for development workflow
|
|
|
|
FROM golang:1.26-alpine as development
|
|
|
|
# Install minimal dependencies including build tools
|
|
RUN apk add --no-cache \
|
|
git \
|
|
curl \
|
|
ca-certificates \
|
|
tzdata \
|
|
gcc \
|
|
musl-dev \
|
|
make
|
|
|
|
# Install delve (debugger) and air (hot reload)
|
|
RUN CGO_ENABLED=0 go install github.com/go-delve/delve/cmd/[email protected]
|
|
RUN CGO_ENABLED=0 go install github.com/air-verse/[email protected]
|
|
|
|
# Create a custom user with appropriate permissions
|
|
RUN addgroup -g 1001 -S appgroup && \
|
|
adduser -u 1001 -S appuser -G appgroup
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Set proper ownership and permissions for the working directory
|
|
RUN chown -R appuser:appgroup /app
|
|
|
|
# Create tmp directory and set permissions
|
|
RUN mkdir -p /app/tmp && chown -R appuser:appgroup /app/tmp && chmod 755 /app/tmp
|
|
|
|
# Create Go cache directory for appuser
|
|
RUN mkdir -p /home/appuser/.cache/go-build && chown -R appuser:appgroup /home/appuser/.cache
|
|
|
|
# Copy go mod files first for better caching
|
|
COPY go.mod go.sum ./
|
|
|
|
# Copy go.mod/go.sum for all local replacements so go mod download can resolve them
|
|
COPY --parents pkg/client/go.mod pkg/domain/go.mod pkg/domain/go.sum ./
|
|
COPY --parents ce/plugins/*/go.mod ce/plugins/*/go.sum ./
|
|
|
|
# Download dependencies (this will be cached in Docker layer)
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Set environment variables for development
|
|
ENV GO111MODULE=on
|
|
ENV CGO_ENABLED=1
|
|
ENV DEBUG=true
|
|
|
|
# Expose ports
|
|
EXPOSE 8080 9090 2345
|
|
# Switch to the custom user
|
|
USER appuser
|
|
|
|
# No command, it needs to be set by docker-compose (different use cases)
|