-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from ZeStream/feat/dockerfile
Added Dockerfile and compose to generate build and run services
- Loading branch information
Showing
12 changed files
with
144 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM golang:latest AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN go build -o main | ||
|
||
FROM alpine:latest AS run-http | ||
WORKDIR /app | ||
COPY --from=builder /app/main ./ | ||
CMD ["./main"] | ||
|
||
FROM alpine:latest AS run-consumer | ||
WORKDIR /app | ||
COPY --from=builder /app/main ./ | ||
CMD ["./main", "--consumer"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM golang:latest AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
ENV GO111MODULE=on \ | ||
CGO_ENABLED=0 \ | ||
GOOS=linux | ||
|
||
RUN go build -o main | ||
|
||
FROM ubuntu:latest AS zestream-consumer | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/main ./ | ||
|
||
RUN apt update | ||
RUN apt install -y ffmpeg | ||
|
||
CMD ["./main", "--consumer"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
version: '3' | ||
services: | ||
zestream-http: | ||
build: | ||
context: ./ | ||
dockerfile: http.Dockerfile | ||
environment: | ||
- PORT=${PORT} | ||
- RABBITMQ_URI=${RABBITMQ_URI} | ||
- GIN_MODE=${GIN_MODE} | ||
- GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS} | ||
- AZURE_ACCOUNT_NAME=${AZURE_ACCOUNT_NAME} | ||
- AZURE_ENDPOINT=${AZURE_ENDPOINT} | ||
- AZURE_ACCESS_KEY=${AZURE_ACCESS_KEY} | ||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} | ||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} | ||
- AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} | ||
ports: | ||
- "8080:${PORT}" | ||
container_name: go-app-http-container | ||
|
||
zestream-consumer: | ||
build: | ||
context: ./ | ||
dockerfile: consumer.Dockerfile | ||
container_name: go-app-consumer-container | ||
environment: | ||
- RABBITMQ_URI=${RABBITMQ_URI} | ||
- GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS} | ||
- AZURE_ACCOUNT_NAME=${AZURE_ACCOUNT_NAME} | ||
- AZURE_ENDPOINT=${AZURE_ENDPOINT} | ||
- AZURE_ACCESS_KEY=${AZURE_ACCESS_KEY} | ||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} | ||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} | ||
- AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} | ||
volumes: | ||
- consumer-data:/app | ||
|
||
volumes: | ||
consumer-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM golang:latest AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
ENV GO111MODULE=on \ | ||
CGO_ENABLED=0 \ | ||
GOOS=linux | ||
|
||
RUN go build -o main | ||
|
||
|
||
FROM ubuntu:latest AS zestream-http | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/main ./ | ||
|
||
CMD ["./main"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters