forked from Misterblue/vircadia-domain-server-docker
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile-ds
97 lines (74 loc) · 3.45 KB
/
Dockerfile-ds
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# build a domain-server using vircadia-builder
FROM domain-server-build-base as domain-server-build
RUN echo UTC >/etc/timezone
# The tag to pull from the Project Athena source repository.
ARG REPO=https://github.com/vircadia/vircadia
ARG TAG=master
# Tell the libraries not to use the interactive dialogs
ARG DEBIAN_FRONTEND=noninteractive
ARG TERM=linux
# =======================================
FROM ubuntu:20.04 as domain-server-run
RUN echo UTC >/etc/timezone
# The tag to pull from the Project Athena source repository. (Note defn in previous stage)
ARG REPO=https://github.com/vircadia/vircadia
ARG TAG=master
# Tell the libraries not to use the interactive dialogs
ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux
RUN adduser --disabled-password --gecos 'domain-server user' cadia
RUN mkdir -p /opt/vircadia/install_master \
&& mkdir -p /opt/vircadia/version \
&& mkdir -p /opt/vircadia/qt5-install/lib \
&& chown -R cadia:cadia /opt/vircadia
COPY --from=domain-server-build --chown=cadia:cadia /opt/vircadia/qt5-install/lib /opt/vircadia/qt5-install/lib
COPY --from=domain-server-build --chown=cadia:cadia /opt/vircadia/install_master /opt/vircadia/install_master
COPY --from=domain-server-build --chown=cadia:cadia /opt/vircadia/builder-deps.txt /opt/vircadia/
COPY --from=domain-server-build --chown=cadia:cadia /opt/vircadia/version /opt/vircadia/version
# The service definitions are built and hidden in /root/.config
COPY --from=domain-server-build --chown=cadia:cadia /root/.config /home/cadia/.config
# Load some debugging and all the required packages
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y vim \
&& apt-get install -y $(cat /opt/vircadia/builder-deps.txt) \
&& apt-get clean \
&& rm -rf /var/lib/app/lists/*
# Get the builder
# ADD https://api.github.com/repos/vircadia/vircadia-builder/git/refs/heads/master vircadia-builder-git-version.json
# RUN cd /opt/vircadia \
# && git clone https://github.com/vircadia/vircadia-builder.git \
# && cd vircadia-builder \
# && chmod +x vircadia-builder
# Build the server pieces
# ENV VIRCADIA_USE_SYSTEM_QT=true
# RUN cd /opt/vircadia/vircadia-builder \
# && ./vircadia-builder \
# --repo=$REPO \
# --tag=$TAG \
# --destdir /opt/vircadia \
# --build=domain-server,assignment-client,ice-server \
# --release-type=production \
# --skip-systemd-restart \
# --auto
# vircadia-builder puts the built image into 'install_$TAG'. Move to "install_master" so later code is simplier
# RUN if [ "$TAG" != "master" ] ; then mv /opt/vircadia/vircadia_20* /opt/vircadia/install_master ; fi
# Add the version of vircadia that was built
# COPY files/buildVersion.sh /tmp
# RUN mkdir -p /opt/vircadia/version \
# && /tmp/buildVersion.sh /opt/vircadia/source /opt/vircadia/version $TAG
USER cadia:cadia
RUN mkdir -p /home/cadia/.config \
&& mkdir -p /home/cadia/.local \
&& mkdir -p /home/cadia/logs
COPY --chown=cadia:cadia files/start-domain-server.sh /home/cadia
COPY --chown=cadia:cadia files/start-ice-server.sh /home/cadia
COPY --chown=cadia:cadia files/getVersion.sh /home/cadia
VOLUME /home/cadia/.local
VOLUME /home/cadia/logs
# expose ports for domain server
# EXPOSE 40100 40101 40102
# EXPOSE 40100/udp 40101/udp 40102/udp
# expose ports for assignment client
# EXPOSE 48000/udp 48001/udp 48002/udp 48003/udp 48004/udp 48005/udp 48006/udp
ENTRYPOINT ["/home/cadia/start-domain-server.sh"]