33 lines
633 B
Docker
33 lines
633 B
Docker
# Dockerfile.local
|
|
# Optimized for local development with hot reload
|
|
|
|
# Build stage
|
|
FROM golang:1.23-alpine AS builder
|
|
|
|
# Install necessary tools for development
|
|
RUN apk add --no-cache git make gcc libc-dev
|
|
|
|
# Install Air for hot reload
|
|
RUN go install github.com/cosmtrek/air@latest
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy go.mod and go.sum files
|
|
COPY go.mod go.sum* ./
|
|
|
|
# Download dependencies
|
|
RUN go mod download
|
|
|
|
# Copy the entire project
|
|
COPY . .
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Set environment variable for development
|
|
ENV APP_ENV=development
|
|
|
|
# Command to run the application with hot reload
|
|
CMD ["air", "-c", ".air.toml"]
|