forked from giongto35/cloud-game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (38 loc) · 962 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# The base cloud-game image
ARG BUILD_PATH=/go/src/github.com/giongto35/cloud-game
# build image
FROM golang:1.14 AS build
ARG BUILD_PATH
WORKDIR ${BUILD_PATH}
# system libs layer
RUN apt-get update && apt-get install -y \
make \
pkg-config \
libvpx-dev \
libopus-dev \
libopusfile-dev \
libsdl2-dev \
&& rm -rf /var/lib/apt/lists/*
# go deps layer
COPY go.mod go.sum ./
RUN go mod download
# app build layer
COPY ./ ./
RUN make build
# base image
FROM debian:10-slim
ARG BUILD_PATH
WORKDIR /usr/local/share/cloud-game
RUN apt-get update && apt-get install -y \
libvpx5 \
libopus0 \
libopusfile0 \
libsdl2-2.0-0 \
libgl1-mesa-glx \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build ${BUILD_PATH}/bin/ ./
# it assumed there are only binary files yet
RUN cp -s $(pwd)/* /usr/local/bin
COPY web ./web
COPY assets/emulator/libretro/cores/*.so ./assets/emulator/libretro/cores/
EXPOSE 8000 9000 3478/tcp 3478/udp