feat: add docker
This commit is contained in:
parent
c6d8a27f3b
commit
f455bd7c6d
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
FROM golang:1.26-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
COPY vendor/ ./vendor/
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -o /app/media-service ./cmd/main.go
|
||||
|
||||
FROM alpine:3.21 AS runner
|
||||
WORKDIR /app
|
||||
ENV APP_ENV=production
|
||||
COPY --from=builder /app/media-service .
|
||||
CMD ["./media-service"]
|
||||
20
compose.yml
Normal file
20
compose.yml
Normal file
@ -0,0 +1,20 @@
|
||||
name: teacinema
|
||||
services:
|
||||
media-service:
|
||||
image: teacinema/media-service:dev
|
||||
container_name: teacinema-media-service
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
env_file:
|
||||
- .env.production.local
|
||||
ports:
|
||||
- '50059:50059'
|
||||
- '4200:4200'
|
||||
networks:
|
||||
- teacinema
|
||||
|
||||
networks:
|
||||
teacinema:
|
||||
external: true
|
||||
Loading…
x
Reference in New Issue
Block a user