init project
This commit is contained in:
29
Dockerfile.dev
Normal file
29
Dockerfile.dev
Normal file
@@ -0,0 +1,29 @@
|
||||
FROM golang:1.23-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Cài đặt các công cụ phát triển
|
||||
RUN apk add --no-cache git make
|
||||
|
||||
# Cài đặt Air cho hot-reload
|
||||
RUN go install github.com/air-verse/air@latest
|
||||
|
||||
# Sao chép file go.mod và go.sum
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
# Tải các dependency
|
||||
RUN go mod download
|
||||
|
||||
# Sao chép file .air.toml
|
||||
COPY .air.toml ./
|
||||
|
||||
# Sao chép toàn bộ mã nguồn
|
||||
COPY . .
|
||||
|
||||
# Expose port
|
||||
ARG PORT=8080
|
||||
ENV PORT=${PORT}
|
||||
EXPOSE ${PORT}
|
||||
|
||||
# Chạy Air để hot-reload
|
||||
CMD ["air"]
|
||||
Reference in New Issue
Block a user