Fix docker stuff

fix_docker_stuff
blallo 2020-10-22 20:29:32 +02:00
parent 8fa584775f
commit 1b89548f64
Signed by: blallo
GPG Key ID: 0CBE577C9B72DC3F
6 changed files with 49 additions and 44 deletions

View File

@ -0,0 +1,3 @@
/external
Makefile
*.md

View File

@ -1,24 +1,17 @@
FROM golang:1.15 AS builder
FROM golang:1.15
ENV DEBIAN_FRONTEND=noninteractive
COPY ./go.* /broadcast/
COPY /*.go /broadcast/
COPY . /broadcast/
WORKDIR /broadcast
RUN apt-get update \
&& apt-get install -y libmp3lame-dev\
&& go get -u ./... \
&& apt-get install -y libmp3lame-dev procps \
&& env go build -o /broadcast/broadcast \
&& cp /broadcast/broadcast /srv/ \
&& cp /broadcast/entrypoint.sh /srv/ \
&& rm -rf /var/lib/apt/lists/*
# RUN env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /broadcast/broadcast
RUN env go build -o /broadcast/broadcast
# RUN go build -o /broadcast/broadcast
# FROM alpine:latest
FROM golang:1.15
WORKDIR /srv
COPY --from=builder /broadcast/broadcast /srv/broadcast
CMD /srv/broadcast
ENTRYPOINT ["/srv/entrypoint.sh"]

View File

@ -0,0 +1,6 @@
#!/bin/bash
trap "exit 0" 1 2 3 15
sleep 5
/srv/broadcast ${@} & wait

View File

@ -0,0 +1,7 @@
version: "3"
services:
broadcast:
depends_on: []
environment:
- MUMBLE_SERVER: parla.abbiamoundominio.org:64738

View File

@ -3,32 +3,32 @@ version: "3"
services:
broadcast:
image: unit/broadcast
build: .
# depends_on:
# - mumble
build: broadcast/
depends_on:
- mumble
environment:
- MUMBLE_SERVER: parla.abbiamoundominio.org:64738
MUMBLE_SERVER: mumble:64738
# icecast:
# image: infiniteproject/icecast
# ports:
# - "8000:80"
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:8000"]
# interval: 30s
# timeout: 1s
# retries: 3
# start_period: 4s
icecast:
image: infiniteproject/icecast
ports:
- "8000:80"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000"]
interval: 30s
timeout: 1s
retries: 3
start_period: 4s
# mumble:
# image: coppit/mumble-server
# ports:
# - "64738:64738"
# volumes:
# - $PWD/mumble:/data
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:64738"]
# interval: 30s
# timeout: 1s
# retries: 3
# start_period: 4s
mumble:
image: coppit/mumble-server
ports:
- "64738:64738"
volumes:
- $PWD/mumble:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:64738"]
interval: 30s
timeout: 1s
retries: 3
start_period: 4s

View File

@ -1,4 +0,0 @@
#!/bin/bash
sleep 5
/srv/broadcast ${@}