Skip to content

Commit

Permalink
chore(*): remove unnecessary Lavalink and Python application scripts …
Browse files Browse the repository at this point in the history
…and configurations
  • Loading branch information
Nat1anWasTaken committed May 13, 2024
1 parent 1818463 commit 204045b
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 71 deletions.
69 changes: 31 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,31 @@
FROM python:3.12.3-slim-bookworm

ARG S6_OVERLAY_VERSION=3.1.6.2 LAVALINK_VERSION=4.0.4 DEBIAN_FRONTEND="noninteractive"

ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp

RUN apt-get update && \
apt-get install -y git curl jq openjdk-17-jre-headless xz-utils \
gcc g++ python3-dev libffi-dev build-essential cmake libjpeg-dev && \
apt-get clean && \
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && \
tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz && \
tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz && \
tar -C / -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz && \
rm -rf /tmp/* && \
groupadd -g 1200 lava && \
useradd lava --system --gid 1200 --uid 1200 --create-home && \
mkdir /lava && \
chown 1200:1200 /lava

COPY --chown=1200:1200 . /lava
WORKDIR /lava
USER lava
RUN rm ./docker -r && \
curl -fsSL https://github.com/lavalink-devs/Lavalink/releases/download/${LAVALINK_VERSION}/Lavalink.jar -o /lava/lavalink.jar

USER root
ENV S6_VERBOSITY=1 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
SHELL=/bin/bash
COPY --chmod=755 ./docker /
RUN python -m pip install -r /lava/requirements.txt

ENTRYPOINT ["/init"]
FROM python:3.12.3-slim as base

ENV PYTHONDONTWRITEBYTECODE=1

ENV PYTHONUNBUFFERED=1

WORKDIR /app

ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser

RUN apt-get update && apt-get install -y git

RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=requirements.txt,target=requirements.txt \
python -m pip install -r requirements.txt

COPY . .

RUN chown -R appuser:appuser /app

USER appuser

CMD python main.py
19 changes: 0 additions & 19 deletions docker/etc/s6-overlay/s6-rc.d/lavalink-server/rootless-run

This file was deleted.

3 changes: 0 additions & 3 deletions docker/etc/s6-overlay/s6-rc.d/lavalink-server/run

This file was deleted.

1 change: 0 additions & 1 deletion docker/etc/s6-overlay/s6-rc.d/lavalink-server/type

This file was deleted.

1 change: 0 additions & 1 deletion docker/etc/s6-overlay/s6-rc.d/lavalink-server/up

This file was deleted.

4 changes: 0 additions & 4 deletions docker/etc/s6-overlay/s6-rc.d/python-application/rootless-run

This file was deleted.

3 changes: 0 additions & 3 deletions docker/etc/s6-overlay/s6-rc.d/python-application/run

This file was deleted.

1 change: 0 additions & 1 deletion docker/etc/s6-overlay/s6-rc.d/python-application/type

This file was deleted.

1 change: 0 additions & 1 deletion docker/etc/s6-overlay/s6-rc.d/python-application/up

This file was deleted.

Empty file.
Empty file.

0 comments on commit 204045b

Please sign in to comment.