misen place back
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
FROM golang:1.26
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Installation de 'air' pour le hot-reloading
|
||||
RUN go install github.com/air-verse/air@latest
|
||||
|
||||
# Copie des fichiers de dépendances en premier (bonne pratique pour le cache Docker)
|
||||
COPY go.mod ./
|
||||
# Si vous avez un go.sum, décommentez la ligne ci-dessous :
|
||||
# COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copie du reste du code
|
||||
COPY . .
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
# Au lieu de compiler manuellement, on lance 'air'
|
||||
CMD ["air"]
|
||||
@@ -2,14 +2,18 @@ services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
dockerfile: Dockerfliedev
|
||||
ports:
|
||||
- "3000:3000"
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
- db
|
||||
command: ["sh", "-c", "sleep 6 && ./main"]
|
||||
|
||||
volumes:
|
||||
- .:/app
|
||||
|
||||
command: ["sh", "-c", "sleep 6 && air"]
|
||||
restart: unless-stopped
|
||||
|
||||
db:
|
||||
|
||||
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user