Add Docker support.
This commit is contained in:
parent
033e35dd6d
commit
c6ac334429
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
FROM golang:alpine AS build
|
||||
|
||||
WORKDIR /go/src/github.com/yukimochi/Activity-Relay
|
||||
COPY . /go/src/github.com/yukimochi/Activity-Relay
|
||||
|
||||
RUN mkdir -p /rootfs/usr/bin && \
|
||||
apk add -U --no-cache git && \
|
||||
go get -u github.com/golang/dep/cmd/dep && \
|
||||
dep ensure && \
|
||||
go build -o /rootfs/usr/bin/server . && \
|
||||
go build -o /rootfs/usr/bin/worker ./worker
|
||||
|
||||
FROM alpine
|
||||
|
||||
COPY --from=build /rootfs/usr/bin /usr/bin
|
||||
RUN chmod +x /usr/bin/server /usr/bin/worker && \
|
||||
apk add -U --no-cache ca-certificates
|
32
docker-compose.yml
Normal file
32
docker-compose.yml
Normal file
@ -0,0 +1,32 @@
|
||||
version: "2.3"
|
||||
services:
|
||||
redis:
|
||||
restart: always
|
||||
image: redis:alpine
|
||||
|
||||
worker:
|
||||
build: .
|
||||
image: yukimochi/activity-relay
|
||||
restart: always
|
||||
init: true
|
||||
command: worker
|
||||
environment:
|
||||
- "ACTOR_PEM=/actor.pem"
|
||||
- "RELAY_DOMAIN=relay.toot.yukimochi.jp"
|
||||
- "REDIS_URL=redis:6379"
|
||||
volumes:
|
||||
- "./actor.pem:/actor.pem"
|
||||
|
||||
server:
|
||||
build: .
|
||||
image: yukimochi/activity-relay
|
||||
restart: always
|
||||
init: true
|
||||
command: server
|
||||
environment:
|
||||
- "ACTOR_PEM=/actor.pem"
|
||||
- "RELAY_DOMAIN=relay.toot.yukimochi.jp"
|
||||
- "RELAY_BIND=0.0.0.0:8080"
|
||||
- "REDIS_URL=redis:6379"
|
||||
volumes:
|
||||
- "./actor.pem:/actor.pem"
|
Loading…
x
Reference in New Issue
Block a user