mirror of
https://github.com/eventials/goevents.git
synced 2025-04-24 13:48:53 +08:00
commit
1056b6f128
28
Dockerfile
28
Dockerfile
@ -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"]
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user