Commit 22551a8d authored by Rafael's avatar Rafael

smaller images for production

parent b1a3bb91
Pipeline #22616450 passed with stage
in 4 minutes and 23 seconds
Dockerfile
production.Dockerfile
README.md
......@@ -8,5 +8,7 @@ regitry:
stage: delivery
script:
- docker login -u $GITLAB_REGISTRY_USERNAME -p $GITLAB_REGISTRY_PASSWORD registry.gitlab.com
- docker build -t registry.gitlab.com/shereland/graphql:stable .
- docker build -t registry.gitlab.com/shereland/graphql:stable -f production.Dockerfile .
- docker push registry.gitlab.com/shereland/graphql:stable
- docker build -t registry.gitlab.com/shereland/graphql:development .
- docker push registry.gitlab.com/shereland/graphql:development
......@@ -12,4 +12,4 @@ RUN go get github.com/githubnemo/CompileDaemon
VOLUME [ "/var/log/graphql" ]
CMD ["/usr/local/go/bin/go", "run", "main/main.go", "main/server.go", "main/relay.go", "main/mail.go"]
CMD CompileDaemon -build='go install main/main.go main/mail.go main/relay.go main/server.go' -command='main'
FROM golang:1.10
EXPOSE 8080
WORKDIR /go/src/gitlab.com/shereland/graphql/main
COPY . ..
ENV GOBIN=/go/bin
RUN go get -d -v ./...
RUN CGO_ENABLED=0 GOOS=linux go build -o graphql -a -ldflags '-extldflags "-static"' .
VOLUME [ "/var/log/graphql" ]
FROM scratch
COPY --from=0 /go/src/gitlab.com/shereland/graphql/main/graphql .
COPY --from=0 /go/src/gitlab.com/shereland/graphql/schema.gql .
ENTRYPOINT ["/graphql"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment