Skip to content

Commit

Permalink
adding docker
Browse files Browse the repository at this point in the history
  • Loading branch information
rafiki270 committed Jul 17, 2019
1 parent a239cfe commit 16f1289
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM einstore/swift:5.1-bionic as builder

WORKDIR /app
COPY . /app

ARG CONFIGURATION="release"

RUN swift build --configuration ${CONFIGURATION} --product systemator

# ------------------------------------------------------------------------------

FROM einstore/swift:5.1-bionic

ARG CONFIGURATION="release"

WORKDIR /app
COPY --from=builder /app/.build/${CONFIGURATION}/systemator /app

EXPOSE 8080

ENTRYPOINT ["/app/systemator"]
CMD ["serve", "--hostname", "0.0.0.0", "--port", "8080"]
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
REPO = einstore
IMAGE = systemator
TAG = 2.1

DEBUG_TAG = local-dev

help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-13s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

run: debug ## Build & run local dev
docker run -p 8080:8080 $(REPO)/$(IMAGE):$(DEBUG_TAG)

debug: ## Build docker image in debug mode
docker build --build-arg CONFIGURATION="debug" -t $(REPO)/$(IMAGE):$(DEBUG_TAG) .

build: ## Release build
docker build -t $(REPO)/$(IMAGE):$(TAG) .

publish: build ## Publish on docker hub
docker tag $(REPO)/$(IMAGE):$(TAG) $(REPO)/$(IMAGE):latest
docker push $(REPO)/$(IMAGE):$(TAG)
docker push $(REPO)/$(IMAGE):latest

0 comments on commit 16f1289

Please sign in to comment.