...
 
Commits (2)
......@@ -53,6 +53,7 @@ tags
# End of https://www.gitignore.io/api/go,vim,linux,visualstudiocode
docker-compose.yml
service-invoicing/service-invoicing
service-product/service-product
service-customer/service-customer
......
FROM openshift/base-centos7
MAINTAINER Yannick Buron [email protected]
FROM node:8.16-alpine AS build
# RUN curl -sL https://rpm.nodesource.com/setup_8.x | bash -
# RUN yum install -y nodejs sudo postgresql
RUN curl -sL https://rpm.nodesource.com/setup_8.x | bash -
RUN yum install -y nodejs sudo postgresql
RUN npm install [email protected] [email protected] -g
RUN npm install yarn sequelize-cli serve -g
# RUN npm install [email protected] [email protected] -g
RUN npm install yarn serve react-scripts -g
COPY . .
RUN yarn install --network-timeout 300000
RUN yarn run build
EXPOSE 5000
FROM node:8.16-alpine
WORKDIR /opt/app-root
RUN npm install yarn serve react-scripts -g
COPY --from=build ./package.json ./package.json
COPY --from=build ./public ./public
COPY --from=build ./src ./src
COPY --from=build ./build ./build
CMD ["serve", "-s", "build"]
......@@ -117,8 +117,9 @@ services:
HYDRA_CLIENT_SECRET: "testtest"
HYDRA_CLUSTER_URL: "http://hydra:4445"
LOGIN_CLUSTER_URL: "http://login"
volumes:
- "$GOPATH:/go"
# Uncomment to link to your local dev environment
# volumes:
# - "$GOPATH:/go"
login:
image: registry.gitlab.com/empowerlab/stack/login/master:latest
networks:
......@@ -142,8 +143,9 @@ services:
HYDRA_CLIENT_SECRET: "testtest"
HYDRA_CLUSTER_URL: "http://hydra:4445"
LOGIN_CLUSTER_URL: "http://localhost:5002"
volumes:
- "$GOPATH:/go"
# Uncomment to link to your local dev environment
# volumes:
# - "$GOPATH:/go"
customer-init:
image: registry.gitlab.com/empowerlab/example/go-factory/master:latest
......@@ -160,8 +162,9 @@ services:
CUSTOMER_AUTO_DEPLOY_SERVICE_PORT: "5000"
NATS_HOST: "nats://nats:4222"
JAEGER_ENDPOINT: "http://jaeger:14268/api/traces"
volumes:
- "$GOPATH:/go"
# Uncomment to link to your local dev environment
# volumes:
# - "$GOPATH:/go"
customer:
image: registry.gitlab.com/empowerlab/example/go-factory/master:latest
networks:
......@@ -177,8 +180,9 @@ services:
CUSTOMER_AUTO_DEPLOY_SERVICE_PORT: "5000"
NATS_HOST: "nats://nats:4222"
JAEGER_ENDPOINT: "http://jaeger:14268/api/traces"
volumes:
- "$GOPATH:/go"
# Uncomment to link to your local dev environment
# volumes:
# - "$GOPATH:/go"
product-init:
......@@ -196,8 +200,9 @@ services:
PRODUCT_AUTO_DEPLOY_SERVICE_PORT: "5000"
NATS_HOST: "nats://nats:4222"
JAEGER_ENDPOINT: "http://jaeger:14268/api/traces"
volumes:
- "$GOPATH:/go"
# Uncomment to link to your local dev environment
# volumes:
# - "$GOPATH:/go"
product:
image: registry.gitlab.com/empowerlab/example/go-factory/master:latest
networks:
......@@ -213,8 +218,9 @@ services:
PRODUCT_AUTO_DEPLOY_SERVICE_PORT: "5000"
NATS_HOST: "nats://nats:4222"
JAEGER_ENDPOINT: "http://jaeger:14268/api/traces"
volumes:
- "$GOPATH:/go"
# Uncomment to link to your local dev environment
# volumes:
# - "$GOPATH:/go"
invoicing-init:
image: registry.gitlab.com/empowerlab/example/go-factory/master:latest
......@@ -235,8 +241,9 @@ services:
JAEGER_ENDPOINT: "http://jaeger:14268/api/traces"
CUSTOMER_SERVICE_HOST: "customer:5000"
PRODUCT_SERVICE_HOST: "product:5000"
volumes:
- "$GOPATH:/go"
# Uncomment to link to your local dev environment
# volumes:
# - "$GOPATH:/go"
invoicing:
image: registry.gitlab.com/empowerlab/example/go-factory/master:latest
networks:
......@@ -256,8 +263,9 @@ services:
JAEGER_ENDPOINT: "http://jaeger:14268/api/traces"
CUSTOMER_SERVICE_HOST: "customer:5000"
PRODUCT_SERVICE_HOST: "product:5000"
volumes:
- "$GOPATH:/go"
# Uncomment to link to your local dev environment
# volumes:
# - "$GOPATH:/go"
gateway:
image: registry.gitlab.com/empowerlab/example/go-factory/master:latest
......@@ -284,8 +292,9 @@ services:
INVOICING_SERVICE_HOST: "invoicing:5000"
LOGIN_SERVICE_HOST: "login:5001"
HYDRA_CLUSTER_URL: "http://hydra:4445"
volumes:
- "$GOPATH:/go"
# Uncomment to link to your local dev environment
# volumes:
# - "$GOPATH:/go"
admin:
image: registry.gitlab.com/empowerlab/example/admin/master:latest
......@@ -296,13 +305,15 @@ services:
- gateway
ports:
- "5000:5000"
command: ["yarn", "run", "start"]
environment:
ADMIN_AUTO_DEPLOY_SERVICE_PORT: "5000"
REACT_APP_GATEWAY_SERVICE_URL: "http://localhost:5001/graphql"
REACT_APP_HYDRA_CLUSTER_URL: "http://localhost:5002"
volumes:
- "$GOPATH/src/gitlab.com/empowerlab/example/admin:/opt/app-root/src"
# Uncomment to link to your local dev environment
# command: ["yarn", "run", "start"]
# volumes:
# - "$GOPATH/src/gitlab.com/empowerlab/example/admin:/opt/app-root"
networks:
empower:
\ No newline at end of file
......@@ -3,9 +3,11 @@ PKG := "gitlab.com/empowerlab/example/$(PROJECT_NAME)"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
CGO_ENABLED=0
GOLANGCI_VERSION = 1.17.1
.PHONY: all dep build clean test coverage coverhtml lint
.PHONY: all dep build install clean test coverage coverhtml lint
all: build
......@@ -39,6 +41,9 @@ dep: ## Get the dependencies
build: dep ## Build the binary file
@go build -i -v $(PKG)
install: ## Build the binary file
@go install $(PKG)
clean: ## Remove previous build
@rm -f $(PROJECT_NAME)
......
FROM golang:1.12
FROM golang:1.13-alpine AS build
WORKDIR /go/src/app
COPY . .
# WORKDIR /go/src/app
# COPY . .
RUN apk add git make protobuf
RUN apt update && apt install unzip
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.9.0/protoc-3.9.0-linux-x86_64.zip -O /tmp/protoc.zip
RUN unzip /tmp/protoc.zip -d /tmp/protoc
RUN mv /tmp/protoc/bin/protoc /usr/bin/protoc
RUN wget https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.3.0/grpc_health_probe-linux-amd64 -O /usr/bin/grpc_health_probe
RUN chmod +x /usr/bin/grpc_health_probe
RUN mkdir -p $GOPATH/src/gitlab.com/empowerlab/example
RUN cp -R ./* $GOPATH/src/gitlab.com/empowerlab/example
# RUN mkdir -p $GOPATH/src/gitlab.com/empowerlab/example
COPY . /go/src/gitlab.com/empowerlab/example
# RUN cp -R ./* $GOPATH/src/gitlab.com/empowerlab/example
RUN go get github.com/gogo/protobuf/protoc-gen-gogofaster
RUN go install github.com/gogo/protobuf/protoc-gen-gogofaster
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/gateway && make dep || true
RUN cd $GOPATH/src/gitlab.com/empowerlab/stack/login && make dep || true
RUN cd $GOPATH/src/gitlab.com/empowerlab/stack/login && go generate
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-customer && make dep || true
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-customer && go generate
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-customer && make dep
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-customer && go install -v ./...
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-product && make dep || true
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-product && go generate
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-product && make dep
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-product && go install -v ./...
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-invoicing && make dep || true
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-invoicing && go generate
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-invoicing && make dep
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-invoicing && go install -v ./...
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/gateway && make dep
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/gateway && go install -v ./...
RUN cd /go/src/gitlab.com/empowerlab/example/gateway && make dep || true
RUN cd /go/src/gitlab.com/empowerlab/stack/login && make dep || true
RUN cd /go/src/gitlab.com/empowerlab/stack/login && go generate
RUN cd /go/src/gitlab.com/empowerlab/example/service-customer && make dep || true
RUN cd /go/src/gitlab.com/empowerlab/example/service-customer && go generate
RUN cd /go/src/gitlab.com/empowerlab/example/service-customer && make dep
RUN cd /go/src/gitlab.com/empowerlab/example/service-customer && make install
RUN cd /go/src/gitlab.com/empowerlab/example/service-product && make dep || true
RUN cd /go/src/gitlab.com/empowerlab/example/service-product && go generate
RUN cd /go/src/gitlab.com/empowerlab/example/service-product && make dep
RUN cd /go/src/gitlab.com/empowerlab/example/service-product && make install
RUN cd /go/src/gitlab.com/empowerlab/example/service-invoicing && make dep || true
RUN cd /go/src/gitlab.com/empowerlab/example/service-invoicing && go generate
RUN cd /go/src/gitlab.com/empowerlab/example/service-invoicing && make dep
RUN cd /go/src/gitlab.com/empowerlab/example/service-invoicing && make install
RUN cd /go/src/gitlab.com/empowerlab/example/gateway && make dep
RUN cd /go/src/gitlab.com/empowerlab/example/gateway && make install
FROM alpine
COPY --from=build /usr/bin/grpc_health_probe /usr/bin/grpc_health_probe
ENV GOPATH /go
ENV PATH /go/bin:$PATH
COPY --from=build /go/src/gitlab.com/empowerlab/example/service-customer /go/src/gitlab.com/empowerlab/example/service-customer
COPY --from=build /go/src/gitlab.com/empowerlab/example/service-product /go/src/gitlab.com/empowerlab/example/service-product
COPY --from=build /go/src/gitlab.com/empowerlab/example/service-invoicing /go/src/gitlab.com/empowerlab/example/service-invoicing
COPY --from=build /go/src/gitlab.com/empowerlab/example/gateway /go/src/gitlab.com/empowerlab/example/gateway
COPY --from=build /go/bin/service-customer /go/bin/service-customer
COPY --from=build /go/bin/service-product /go/bin/service-product
COPY --from=build /go/bin/service-invoicing /go/bin/service-invoicing
COPY --from=build /go/bin/gateway /go/bin/gateway
FROM golang:1.12
WORKDIR /go/src/app
COPY . .
RUN apt update && apt install unzip
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.9.0/protoc-3.9.0-linux-x86_64.zip -O /tmp/protoc.zip
RUN unzip /tmp/protoc.zip -d /tmp/protoc
RUN mv /tmp/protoc/bin/protoc /usr/bin/protoc
RUN wget https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.3.0/grpc_health_probe-linux-amd64 -O /usr/bin/grpc_health_probe
RUN chmod +x /usr/bin/grpc_health_probe
RUN mkdir -p $GOPATH/src/gitlab.com/empowerlab/example
RUN cp -R ./* $GOPATH/src/gitlab.com/empowerlab/example
#RUN ls -al ./
#RUN ls -al $GOPATH/src/gitlab.com/empowerlab/example
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-invoicing
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-invoicing && make dep || true
RUN go install github.com/gogo/protobuf/protoc-gen-gogofaster
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-product && make dep || true
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-product && go generate
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-product && make dep
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-customer && make dep || true
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-customer && go generate
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-customer && make dep
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-invoicing && go generate
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-invoicing && make dep
RUN cd $GOPATH/src/gitlab.com/empowerlab/example/service-invoicing && go install -v ./...
CMD ["service-invoicing"]
\ No newline at end of file
......@@ -3,9 +3,11 @@ PKG := "gitlab.com/empowerlab/example/$(PROJECT_NAME)"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
CGO_ENABLED=0
GOLANGCI_VERSION = 1.17.1
.PHONY: all dep build clean test coverage coverhtml lint
.PHONY: all dep build install clean test coverage coverhtml lint
all: build
......@@ -39,6 +41,9 @@ dep: ## Get the dependencies
build: ## Build the binary file
@go build -i -v $(PKG)
install: ## Build the binary file
@go install $(PKG)
clean: ## Remove previous build
@rm -f $(PROJECT_NAME)
......
......@@ -2,15 +2,15 @@ package main
import (
"gitlab.com/empowerlab/example/service-customer/graphql"
// "gitlab.com/empowerlab/example/service-customer/grpc"
// "gitlab.com/empowerlab/example/service-customer/orm"
"gitlab.com/empowerlab/example/service-customer/grpc"
"gitlab.com/empowerlab/example/service-customer/orm"
)
func main() {
// orm.Definitions.GenProtos()
// orm.Definitions.Gen()
// grpc.Definitions.GenProtos()
// grpc.Definitions.GenServer()
// grpc.Definitions.GenClient()
orm.Definitions.GenProtos()
orm.Definitions.Gen()
grpc.Definitions.GenProtos()
grpc.Definitions.GenServer()
grpc.Definitions.GenClient()
graphql.Definitions.Gen()
}
......@@ -3,9 +3,11 @@ PKG := "gitlab.com/empowerlab/example/$(PROJECT_NAME)"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
CGO_ENABLED=0
GOLANGCI_VERSION = 1.17.1
.PHONY: all dep build clean test coverage coverhtml lint
.PHONY: all dep build install clean test coverage coverhtml lint
all: build
......@@ -39,6 +41,9 @@ dep: ## Get the dependencies
build: ## Build the binary file
@go build -i -v $(PKG)
install: ## Build the binary file
@go install $(PKG)
clean: ## Remove previous build
@rm -f $(PROJECT_NAME)
......
......@@ -3,9 +3,11 @@ PKG := "gitlab.com/empowerlab/example/$(PROJECT_NAME)"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
CGO_ENABLED=0
GOLANGCI_VERSION = 1.17.1
.PHONY: all dep build clean test coverage coverhtml lint
.PHONY: all dep build install clean test coverage coverhtml lint
all: build
......@@ -39,6 +41,9 @@ dep: ## Get the dependencies
build: ## Build the binary file
@go build -i -v $(PKG)
install: ## Build the binary file
@go install $(PKG)
clean: ## Remove previous build
@rm -f $(PROJECT_NAME)
......