1
0
mirror of https://github.com/eventials/goevents.git synced 2025-04-24 13:48:53 +08:00

Improved docker files

This commit is contained in:
Jonathan A. Schweder 2018-06-15 10:40:03 -03:00
parent 9692e82e24
commit cbecd945e3
2 changed files with 25 additions and 8 deletions

View File

@ -1,12 +1,28 @@
FROM golang:1.10
RUN apt-get update && apt-get install -y wget
RUN wget https://github.com/jwilder/dockerize/releases/download/v0.2.0/dockerize-linux-amd64-v0.2.0.tar.gz
RUN tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.2.0.tar.gz
ARG PLATFORM=linux
ENV PLATFORM $PLATFORM_VERSION
ARG ARCH=amd64
ENV ARCH $ARCH_VERSION
ARG DOCKERIZE_VERSION=v0.2.0
ENV DOCKERIZE_VERSION $DOCKERIZE_VERSION
ADD https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-$PLATFORM-$ARCH-$DOCKERIZE_VERSION.tar.gz /usr/local/bin
RUN cd /usr/local/bin \
&& tar -xzf ./dockerize-$PLATFORM-$ARCH-$DOCKERIZE_VERSION.tar.gz \
&& rm -f ./dockerize-$PLATFORM-$ARCH-$DOCKERIZE_VERSION.tar.gz
RUN mkdir -p /go/src/github.com/eventials/goevents
WORKDIR /go/src/github.com/eventials/goevents
RUN go get github.com/streadway/amqp
RUN go get github.com/sirupsen/logrus
RUN go get github.com/stretchr/testify
RUN go get \
github.com/streadway/amqp \
github.com/sirupsen/logrus \
github.com/stretchr/testify
ENTRYPOINT ["dockerize"]
CMD ["-wait", "tcp://broker:5672", "-timeout", "60s", "go", "run", "examples/consumer/consumer.go"]

View File

@ -2,12 +2,13 @@ version: '2'
services:
app:
build: .
working_dir: /go/src/github.com/eventials/goevents
command: dockerize -wait tcp://broker:5672 -timeout 60s go run examples/consumer/consumer.go
links:
- broker
depends_on:
- broker
volumes:
- .:/go/src/github.com/eventials/goevents
broker:
image: rabbitmq:3.6-management
ports: