mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-21 09:08:57 +00:00
Removes separate config files for Libretro cores stored in the cores folder and replaces them with options in the main config.yaml file.
65 lines
1.4 KiB
Docker
65 lines
1.4 KiB
Docker
# The base cloud-game image
|
|
ARG BUILD_PATH=/go/src/github.com/giongto35/cloud-game
|
|
|
|
# build image
|
|
FROM debian:bullseye-slim AS build
|
|
ARG BUILD_PATH
|
|
WORKDIR ${BUILD_PATH}
|
|
|
|
# system libs layer
|
|
RUN apt-get -qq update && apt-get -qq install --no-install-recommends -y \
|
|
gcc \
|
|
ca-certificates \
|
|
libopus-dev \
|
|
libsdl2-dev \
|
|
libvpx-dev \
|
|
libx264-dev \
|
|
make \
|
|
pkg-config \
|
|
wget \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# go setup layer
|
|
ARG GO=go1.20.2.linux-amd64.tar.gz
|
|
RUN wget -q https://golang.org/dl/$GO \
|
|
&& rm -rf /usr/local/go \
|
|
&& tar -C /usr/local -xzf $GO \
|
|
&& rm $GO
|
|
ENV PATH="${PATH}:/usr/local/go/bin"
|
|
|
|
# go deps layer
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# app build layer
|
|
COPY pkg ./pkg
|
|
COPY cmd ./cmd
|
|
COPY Makefile .
|
|
COPY scripts/version.sh scripts/version.sh
|
|
ARG VERSION
|
|
RUN GIT_VERSION=${VERSION} make build
|
|
|
|
# base image
|
|
FROM debian:bullseye-slim
|
|
ARG BUILD_PATH
|
|
WORKDIR /usr/local/share/cloud-game
|
|
|
|
COPY scripts/install.sh install.sh
|
|
RUN bash install.sh && \
|
|
rm -rf /var/lib/apt/lists/* install.sh
|
|
|
|
COPY --from=build ${BUILD_PATH}/bin/ ./
|
|
RUN cp -s $(pwd)/* /usr/local/bin
|
|
RUN mkdir -p ./assets/cache && \
|
|
mkdir -p ./assets/cores && \
|
|
mkdir -p ./assets/games && \
|
|
mkdir -p ./libretro && \
|
|
mkdir -p /root/.cr
|
|
COPY configs ./configs
|
|
COPY web ./web
|
|
ARG VERSION
|
|
COPY scripts/version.sh version.sh
|
|
RUN bash ./version.sh ./web/index.html ${VERSION} && \
|
|
rm -rf version.sh
|
|
|
|
EXPOSE 8000 9000
|