-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
39 lines (27 loc) · 946 Bytes
/
Copy pathDockerfile.dev
File metadata and controls
39 lines (27 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Development Dockerfile with Air hot reload
FROM golang:1.25-alpine
# Install development tools
RUN apk add --no-cache git curl
WORKDIR /app
# Install Air for hot reload
RUN go install github.com/air-verse/air@latest
# Install Templ
RUN go install github.com/a-h/templ/cmd/templ@latest
# Download Tailwind CSS standalone CLI
RUN curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.17/tailwindcss-linux-x64 && \
chmod +x tailwindcss-linux-x64 && \
mv tailwindcss-linux-x64 /usr/local/bin/tailwindcss
# Copy go mod files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy the entire project (will be overridden by volume mount)
COPY . .
# Generate Templ files initially
RUN templ generate
# Build Tailwind CSS initially
RUN tailwindcss -i ./static/css/input.css -o ./static/css/output.css --minify
# Expose port
EXPOSE 8080
# Run Air for hot reload
CMD ["air", "-c", ".air.toml"]