Skip to content

Commit

Permalink
Define services
Browse files Browse the repository at this point in the history
  • Loading branch information
tinrab committed May 25, 2018
1 parent c42eafd commit 22b0763
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
10 changes: 10 additions & 0 deletions account/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM golang:1.10.2 AS build
WORKDIR /go/src/app
COPY . .
RUN go get -d -v ./...
RUN env GOOS=linux GARCH=amd64 go install -v -a -tags netgo -installsuffix netgo -ldflags "-linkmode external -extldflags -static"

FROM alpine:3.7
WORKDIR /usr/bin
COPY --from=build /go/bin .
CMD ["app"]
10 changes: 10 additions & 0 deletions catalog/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM golang:1.10.2 AS build
WORKDIR /go/src/app
COPY . .
RUN go get -d -v ./...
RUN env GOOS=linux GARCH=amd64 go install -v -a -tags netgo -installsuffix netgo -ldflags "-linkmode external -extldflags -static"

FROM alpine:3.7
WORKDIR /usr/bin
COPY --from=build /go/bin .
CMD ["app"]
31 changes: 31 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: "3.6"

services:
account:
build: "./account"
ports:
- "8000:8080"
depends_on:
- "account_db"
catalog:
build: "./catalog"
ports:
- "8001:8080"
depends_on:
- "catalog_db"
- "catalog_cache"
order:
build: "./order"
ports:
- "8002:8080"
depends_on:
- "order_db"

account_db:
image: "cockroachdb/cockroach:v2.0.2"
catalog_db:
image: "cockroachdb/cockroach:v2.0.2"
catalog_cache:
image: "redis:4.0.9"
order_db:
image: "cockroachdb/cockroach:v2.0.2"
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/tinrab/spidey

require github.com/julienschmidt/httprouter v0.0.0-20180411154501-adbc77eec0d9
10 changes: 10 additions & 0 deletions order/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM golang:1.10.2 AS build
WORKDIR /go/src/app
COPY . .
RUN go get -d -v ./...
RUN env GOOS=linux GARCH=amd64 go install -v -a -tags netgo -installsuffix netgo -ldflags "-linkmode external -extldflags -static"

FROM alpine:3.7
WORKDIR /usr/bin
COPY --from=build /go/bin .
CMD ["app"]

0 comments on commit 22b0763

Please sign in to comment.