mirror of
https://codeberg.org/SafeTwitch/safetwitch-backend.git
synced 2025-01-03 03:10:05 -05:00
Add docker support
This commit is contained in:
parent
45a1612d02
commit
5ed7d3d2f4
2 changed files with 29 additions and 0 deletions
19
Dockerfile
Normal file
19
Dockerfile
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
FROM golang:1.20.3 as builder
|
||||||
|
|
||||||
|
# Create and change to the app directory.
|
||||||
|
WORKDIR /app
|
||||||
|
COPY go.* ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . ./
|
||||||
|
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o server
|
||||||
|
|
||||||
|
FROM alpine:3
|
||||||
|
RUN apk add --no-cache ca-certificates
|
||||||
|
|
||||||
|
COPY --from=builder /app/server /server
|
||||||
|
ENV PORT=8080
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENTRYPOINT ["/server"]
|
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
version: "3.9"
|
||||||
|
services:
|
||||||
|
backend:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./Dockerfile
|
||||||
|
ports:
|
||||||
|
- "7000:8080"
|
||||||
|
environment:
|
||||||
|
- URL=http://localhost:7000
|
Loading…
Reference in a new issue