Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ RUN cargo build --release --all
########## RUNTIME CONTAINER ##########

FROM alpine:3.18
ARG PLAYIT_GUID=2000
ARG PLAYIT_UUID=2000
RUN apk add --no-cache ca-certificates

COPY --from=build-env /src/playit-agent/target/release/playit-cli /usr/local/bin/playit
RUN mkdir /playit
COPY docker/entrypoint.sh /playit/entrypoint.sh
RUN chmod +x /playit/entrypoint.sh
COPY --chmod=1755 docker/entrypoint.sh /playit/

RUN addgroup -g ${PLAYIT_GUID} playit && adduser -S --no-create-home -u ${PLAYIT_UUID} -G playit playit
USER playit

ENTRYPOINT ["/playit/entrypoint.sh"]
16 changes: 15 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,18 @@ if [ -z "${SECRET_KEY}" ]; then
fi
fi

playit -s --secret "${SECRET_KEY}" --platform_docker start
term_handler() {

echo "Shutting down Playit."
kill -SIGTERM $PlayitPID
wait $PlayitPID
exit
}
trap 'term_handler' SIGTERM


playit -s --secret "${SECRET_KEY}" --platform_docker start &

PlayitPID=$!

wait $PlayitPID