Skip to content

Commit

Permalink
preparing to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
serg123e committed May 5, 2023
1 parent b41f7ee commit 61ba0dd
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 24 deletions.
1 change: 0 additions & 1 deletion .env

This file was deleted.

16 changes: 16 additions & 0 deletions Dockerfile.icecast
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:latest

ARG UID
ARG GID

RUN addgroup -g ${GID} -S icecast && \
adduser --uid ${UID} -S icecast icecast

RUN apk add --update \
icecast \
mailcap && \
rm -rf /var/cache/apk/*

EXPOSE 8000
VOLUME ["/var/log/icecast"]
CMD icecast -c /etc/icecast.xml
18 changes: 11 additions & 7 deletions Dockerfile.music.mpd
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
FROM alpine:latest

ARG UID
ARG GID

RUN addgroup -g ${GID} -S mpd && adduser --uid ${UID} -S -G mpd mpd

RUN apk update && \
apk add mpd
RUN apk add lsof bash

# COPY mpd.music.conf /etc/mpd.conf
COPY ./jingles/nightingale_singing.mp3 /usr/share/icecast/web/

RUN addgroup mpd
RUN mkdir -p /music
RUN mkdir -p /mpd
RUN mkdir -p /mpd/db
RUN mkdir -p /mpd/playlists

RUN chown -R mpd:mpd /mpd
RUN chown -R mpd:mpd /music

VOLUME /music
VOLUME /mpd

# CMD ["lsof", "-i", ":6600"]
USER mpd
CMD ["mpd", "--stderr", "--no-daemon", "/etc/mpd.conf"]
5 changes: 5 additions & 0 deletions Dockerfile.py.bot
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
FROM python:3.9-alpine

ARG UID
ARG GID

RUN addgroup -g ${GID} -S bot && adduser --uid ${UID} -S -G bot bot

WORKDIR /app

COPY requirements.txt .
Expand Down
9 changes: 4 additions & 5 deletions Dockerfile.voice.mpd
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM alpine:latest

ARG UID
ARG GID
RUN addgroup -g ${GID} -S mpd && adduser --uid ${UID} -S -G mpd mpd

RUN apk update && \
apk add mpd
RUN apk add lsof bash

RUN addgroup mpd
RUN mkdir -p /voice
RUN mkdir -p /mpd

VOLUME /music
VOLUME /mpd
Expand Down
2 changes: 2 additions & 0 deletions bot.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TELEGRAM_BOT_TOKEN="!!! Get token from @BotFather and put it here !!!"

24 changes: 14 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,50 @@
version: '3.8'
version: '3.8'
services:
icecast:
user: icecast
image: infiniteproject/icecast
user: "${UID}:${GID}"
build:
context: .
dockerfile: Dockerfile.voice.mpd
image: irirangi-icecast-image
ports:
- "8000:8000"
volumes:
- ./icecast.xml:/etc/icecast.xml
- ./music:/music
- ./jingles:/usr/share/icecast/web/jingles
- ./logs/icecast:/var/log/icecast
mpd-voice:
user: mpd
user: "${UID}:${GID}"
build:
context: .
dockerfile: Dockerfile.voice.mpd
image: irirangi-mpd-voice-image:latest
image: irirangi-mpd-voice-image
volumes:
- ./mpd.voice.conf:/etc/mpd.conf
- ./voice:/voice
- ./mpd:/mpd

mpd:
user: mpd
user: "${UID}:${GID}"
build:
context: .
dockerfile: Dockerfile.music.mpd
image: irirangi-mpd-image:latest
image: irirangi-mpd-image
volumes:
- ./mpd/run/:/run/mpd/
- ./mpd.music.conf:/etc/mpd.conf
- ./music:/music
- ./mpd:/mpd

bot:
user: "${UID}:${GID}"
build:
context: .
dockerfile: Dockerfile.py.bot
image: irirangi-telegram-bot:latest
image: irirangi-telegram-bot
env_file:
- bot.env
volumes:
- ./music:/music
- ./voice:/voice
- ./app:/app
command: /bin/sh -c "sleep 2 && python /app/bot.py"
restart: unless-stopped
Empty file added logs/.keep
Empty file.
2 changes: 1 addition & 1 deletion mpd.voice.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ audio_output {
music_directory "/voice"

# Set the playlist directory
playlist_directory "/mpd/playlists.voice"
playlist_directory "/mpd/playlists"

# Set the database directory
db_file "/mpd/tag_cache.voice"
Expand Down
Empty file added mpd/playlists/.keep
Empty file.
Empty file added mpd/run/.keep
Empty file.

0 comments on commit 61ba0dd

Please sign in to comment.