Skip to content

Commit

Permalink
add docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaniog committed Jul 5, 2024
1 parent bde8839 commit 1a7a9aa
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Build stage
FROM golang:1.22-alpine AS builder

WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -o snaker ./main.go

# Run stage
FROM alpine:latest

WORKDIR /app

COPY --from=builder /app/snaker .

CMD ["./snaker"]

8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
compose-up:
docker compose up --build -d && docker compose logs -f

lint:
golangci-lint run

run:
go run main.go
8 changes: 8 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
app:
container_name: app
build: .
ports:
- "8000:8000"
restart: unless-stopped

0 comments on commit 1a7a9aa

Please sign in to comment.