Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #20 from adam-stanek/docker-split
Browse files Browse the repository at this point in the history
Split docker files
  • Loading branch information
dskaggs authored Feb 6, 2021
2 parents 0173f0b + f1e72a3 commit d0e6593
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 40 deletions.
19 changes: 0 additions & 19 deletions Dockerfile

This file was deleted.

21 changes: 21 additions & 0 deletions Dockerfile.email
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM golang:1.15-buster AS build

RUN apt-get update && apt-get install -y --no-install-recommends bash curl git ca-certificates
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

WORKDIR /go/src/github.com/analogj/lodestone-publisher/

ADD Gopkg.toml ./
ADD Gopkg.lock ./
ADD cmd ./cmd
ADD pkg ./pkg

RUN dep ensure
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/lodestone-email-publisher ./cmd/email-publisher/email-publisher.go
RUN mkdir tmp

FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /go/src/github.com/analogj/lodestone-publisher/tmp /tmp
COPY --from=build /go/src/github.com/analogj/lodestone-publisher/bin/lodestone-email-publisher /lodestone-email-publisher
CMD ["/lodestone-email-publisher"]
18 changes: 18 additions & 0 deletions Dockerfile.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.15-buster AS build

RUN apt-get update && apt-get install -y --no-install-recommends bash curl git
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

WORKDIR /go/src/github.com/analogj/lodestone-publisher/

ADD Gopkg.toml ./
ADD Gopkg.lock ./
ADD cmd ./cmd
ADD pkg ./pkg

RUN dep ensure
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o lodestone-fs-publisher ./cmd/fs-publisher/fs-publisher.go

FROM scratch
COPY --from=build /go/src/github.com/analogj/lodestone-publisher/lodestone-fs-publisher /lodestone-fs-publisher
CMD ["/lodestone-fs-publisher"]
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# lodestone-publisher


# Local Development
# How to build

```
docker build --tag=lodestone-publisher .
docker run -v `pwd`:/go/src/github.com/analogj/lodestone-publisher/ lodestone-publisher
```bash
docker build -f Dockerfile.fs -t lodestone-fs-publisher .
docker run lodestone-fs-publisher

docker build -f Dockerfile.email -t lodestone-email-publisher .
docker run lodestone-email-processor
```

17 changes: 0 additions & 17 deletions packagr.yml

This file was deleted.

0 comments on commit d0e6593

Please sign in to comment.