feat: add docker

This commit is contained in:
Sergey Krylov 2026-04-05 08:21:46 +03:00
parent c6d8a27f3b
commit f455bd7c6d
2 changed files with 32 additions and 0 deletions

12
Dockerfile Normal file
View 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
View 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