diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..720e7a08 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,24 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2a920754 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +#build stage +FROM golang:alpine AS builder +RUN apk add --no-cache git +WORKDIR /app +COPY . . +RUN CGO_ENABLE=0 GOOS=linux GOARCH=amd64 go build -o bin/server-linux-amd64 -ldflags "-s -w" cmd/server/main.go + + +#final stage +FROM alpine:latest +RUN apk --no-cache add ca-certificates +COPY --from=builder /app/bin/server-linux-amd64 /app +COPY ./configs ./configs +LABEL Name=flutterwebrtcserver Version=0.0.1 +EXPOSE 8086 +ENTRYPOINT /app +CMD [ "/app/server-linux-amd64" ] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 00000000..5b64ec4c --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,7 @@ +version: "3.8" +services: + web: + container_name: flutterwebrtcserver + build: ./ + ports: + - "8086:8086"