init
This commit is contained in:
27
backend/Dockerfile.dev
Normal file
27
backend/Dockerfile.dev
Normal file
@@ -0,0 +1,27 @@
|
||||
# Development Dockerfile with hot reload
|
||||
FROM golang:1.24-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install air for hot reload
|
||||
# Use GOTOOLCHAIN=auto to allow Go to download a newer toolchain if needed
|
||||
ENV GOTOOLCHAIN=auto
|
||||
RUN go install github.com/air-verse/air@latest
|
||||
|
||||
# Install migrate for database migrations
|
||||
RUN go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
|
||||
|
||||
# Copy go mod files first for caching
|
||||
COPY go.mod ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy source code (will be overridden by volume mount)
|
||||
COPY . .
|
||||
|
||||
# Create data directory
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
# Use air for hot reload
|
||||
CMD ["air", "-c", ".air.toml"]
|
||||
Reference in New Issue
Block a user