Skip to content

Commit

Permalink
fix: dockerfile binary entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sundowndev committed Dec 21, 2020
1 parent 112b9da commit a70ee4a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
20 changes: 11 additions & 9 deletions .support/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
LABEL maintainer="Sundowndev" \
FROM node:12.20-alpine

LABEL maintainer="raphael@crvx.fr" \
org.label-schema.name="Gilfoyle" \
org.label-schema.description="Cloud-native solution to embed media streaming in any application at any scale." \
org.label-schema.url="https://github.com/dreamvo/gilfoyle" \
org.label-schema.vcs-url="https://github.com/dreamvo/gilfoyle" \
org.label-schema.vendor="Dreamvo" \
org.label-schema.schema-version="0.1"

FROM node:12.20-alpine

WORKDIR /usr/src/app
COPY ./dashboard/ui .
RUN yarn install
Expand All @@ -16,14 +16,16 @@ RUN yarn build
FROM golang:1.15.6-alpine

WORKDIR /app
RUN apk add build-base

RUN set -ex && \
apk add --no-cache ffmpeg ffmpeg-libs && \
apk add --no-cache gcc build-base linux-headers

COPY . .
COPY --from=0 /usr/src/app/dist ./dashboard/ui/dist
RUN apk add git ffmpeg

RUN go get -v -t -d ./...
RUN go generate ./...
RUN go build -v -ldflags="-s -w -X 'github.com/dreamvo/gilfoyle/config.Version=$(git describe --abbrev=0 --tags)' -X 'github.com/dreamvo/gilfoyle/config.Commit=$(git rev-parse --short HEAD)'" -v -o gilfoyle .
RUN GOOS=linux go build -v -ldflags="-s -w -X 'github.com/dreamvo/gilfoyle/config.Version=$(git describe --abbrev=0 --tags)' -X 'github.com/dreamvo/gilfoyle/config.Commit=$(git rev-parse --short HEAD)'" -v -o gilfoyle ./cmd/main.go

FROM scratch
COPY --from=1 /app/gilfoyle /bin/gilfoyle
ENTRYPOINT ["gilfoyle"]
ENTRYPOINT ["/app/gilfoyle"]
13 changes: 11 additions & 2 deletions .support/docker/docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ services:
restart: on-failure
build:
context: ../../
dockerfile: ../docker/Dockerfile
dockerfile: .support/docker/Dockerfile
command:
- "serve"
- "-p"
- "3000"
ports:
- 3000:3000

db:
postgres:
image: postgres:latest
restart: on-failure
ports:
Expand All @@ -22,3 +22,12 @@ services:
POSTGRES_USER: postgres
POSTGRES_DB: gilfoyle
POSTGRES_PASSWORD: secret

rabbitmq:
image: rabbitmq:3.8-alpine
restart: on-failure
environment:
RABBITMQ_DEFAULT_USER: gilfoyle
RABBITMQ_DEFAULT_PASS: secret
ports:
- 5672:5672

0 comments on commit a70ee4a

Please sign in to comment.