Browse Source

build: enhance docker image build

pull/2/head
Dnomd343 2 years ago
parent
commit
edc469deff
  1. 33
      Dockerfile
  2. 2
      init.sh

33
Dockerfile

@ -1,13 +1,24 @@
FROM python:3.7-alpine as build
RUN apk add build-base cargo git libffi-dev openssl-dev && \
pip install -U pip && cd / && mkdir wheels && \
git clone --depth=1 --branch=v1.6.9 https://github.com/syncplay/syncplay.git && \
echo "" > syncplay/requirements_gui.txt && \
cd wheels && SNAPCRAFT_PART_BUILD=1 pip wheel file:///syncplay#egg=syncplay
ARG PYTHON="python:3.7-alpine3.17"
FROM python:3.7-alpine
COPY ./init.sh /syncplay
COPY --from=build /wheels /wheels
RUN apk add --no-cache openssl libffi && pip install /wheels/*.whl
FROM ${PYTHON} as build
ENV SYNCPLAY="1.6.9"
RUN apk add gcc musl-dev libffi-dev
RUN wget https://github.com/Syncplay/syncplay/archive/refs/tags/v${SYNCPLAY}.tar.gz && \
tar xf v${SYNCPLAY}.tar.gz
WORKDIR ./syncplay-${SYNCPLAY}/
RUN cat /dev/null > requirements_gui.txt
RUN SNAPCRAFT_PART_BUILD=1 pip wheel --wheel-dir /wheels/ ./
WORKDIR /wheels/
RUN pip install *.whl
RUN ls *.whl | xargs -P0 -n1 unzip -d /unzip/
WORKDIR /release/lib/python3.7/
RUN cp -r /unzip/ ./site-packages/
WORKDIR /release/bin/
RUN cp /usr/local/bin/syncplay-server ./
COPY ./init.sh ./syncplay
FROM ${PYTHON}
RUN apk add --no-cache libffi openssl
COPY --from=build /release/ /usr/local/
EXPOSE 8999
ENTRYPOINT ["/syncplay"]
ENTRYPOINT ["syncplay"]

2
init.sh

@ -1,5 +1,7 @@
#!/bin/sh
echo "boot start"
args="--salt=$SALT"
[ -n "$TLS" ] && args="$args --tls=$TLS"

Loading…
Cancel
Save