1
0
Fork 0
mirror of https://github.com/fastogt/fastocloud.git synced 2025-03-09 23:18:50 +00:00

Docker review

This commit is contained in:
atopilski 2023-07-07 21:25:53 -06:00
parent 8cbd146565
commit 6c5fc368be
4 changed files with 52 additions and 4 deletions

View file

@ -4,7 +4,7 @@ LABEL maintainer="Alexandr Topilski <support@fastogt.com>"
ENV USER fastocloud
ENV APP_NAME fastocloud
ENV PROJECT_DIR /usr/src/fastocloud
ENV PROJECT_DIR /usr/src/$APP_NAME
RUN useradd -m -U -d /home/$USER $USER -s /bin/bash
COPY . $PROJECT_DIR
@ -22,13 +22,18 @@ RUN set -ex; \
cd $PROJECT_DIR/build && PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig python3 build.py release $PREFIX; \
rm -rf $PYFASTOGT_DIR $PROJECT_DIR # && apt-get purge -y --auto-remove $BUILD_DEPS
COPY docker/$APP_NAME.conf /etc/
RUN mkdir /var/run/$APP_NAME
RUN chown $USER:$USER /var/run/$APP_NAME
VOLUME /var/run/$APP_NAME
RUN chown $USER:$USER /var/lib/dbus/ # for unique machine-id
#VOLUME /var/run/$APP_NAME
COPY docker/docker-entrypoint.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh
USER $USER
WORKDIR /home/$USER
ENTRYPOINT ["fastocloud"]
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 6317 8000 7000 6000

@ -1 +1 @@
Subproject commit 87955c8e0ef311735b8305cc026c4d66942be3d8
Subproject commit 20017646e9707187190f21de8d0a3978ac74dea4

View file

@ -0,0 +1,22 @@
#!/bin/sh
#set -e
regenerate_dbus_machine_id() {
rm -f /var/lib/dbus/machine-id
rm -f /etc/machine-id
dbus-uuidgen --ensure
}
CONTAINER_ALREADY_STARTED="CONTAINER_ALREADY_STARTED_PLACEHOLDER"
if [ ! -e $CONTAINER_ALREADY_STARTED ]; then
touch $CONTAINER_ALREADY_STARTED
regenerate_dbus_machine_id
else
echo "machine-id already was regenerated"
fi
if [ "${1#-}" != "$1" ]; then
set -- fastocloud "$@"
fi
exec "$@"

21
docker/fastocloud.conf Normal file
View file

@ -0,0 +1,21 @@
[settings]
log_path=~/fastocloud.log
log_level=INFO
host=0.0.0.0:6317
alias=0.0.0.0
hls_host=http://0.0.0.0:8000
vods_host=http://0.0.0.0:7000
cods_host=http://0.0.0.0:6000
hls_dir=~/streamer/hls
vods_dir=~/streamer/vods
cods_dir=~/streamer/cods
timeshifts_dir=~/streamer/timeshifts
feedback_dir=~/streamer/feedback
proxy_dir=~/streamer/proxy
data_dir=~/streamer/data
cods_ttl=600
pyfastostream_path=/usr/local/bin/pyfastostream
files_ttl=604800