-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
39 lines (34 loc) · 1.32 KB
/
docker-entrypoint.sh
File metadata and controls
39 lines (34 loc) · 1.32 KB
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
#!/bin/bash
CARBONE_USE_S3_PLUGIN=${CARBONE_USE_S3_PLUGIN:-true}
CARBONE_EE_WORKDIR=${CARBONE_EE_WORKDIR:-/app}
if [ $CARBONE_EE_WORKDIR != "/app" ]; then
mkdir ${CARBONE_EE_WORKDIR}
fi
CONTAINER_ALREADY_STARTED="CONTAINER_ALREADY_STARTED_PLACEHOLDER"
if [ ! -e $CONTAINER_ALREADY_STARTED ]; then
touch $CONTAINER_ALREADY_STARTED
if [ "$CARBONE_USE_AZURE_PLUGIN" = true ]; then
echo "Configuring Carbone with Azure plugin"
cp -r /app/plugin-azure/node_modules ${CARBONE_EE_WORKDIR}/plugin/
cp -r /app/plugin-azure/*.js ${CARBONE_EE_WORKDIR}/plugin/
elif [ "$CARBONE_USE_S3_PLUGIN" = true ]; then
echo "Configuring Carbone with S3 plugin"
cp -r /app/plugin-s3/node_modules ${CARBONE_EE_WORKDIR}/plugin/
cp -r /app/plugin-s3/*.js ${CARBONE_EE_WORKDIR}/plugin/
fi
fi
if [ "$CARBONE_DISABLE_CHROME" = true ]; then
echo "Chromium converter is disabled"
unset CARBONE_EE_CHROMEPATH
else
## For Chrome execution, we need first to test if sys_admin cap is enabled
## if disable, we force no-sandbox mode
SYS_ADMIN=`setpriv -d | grep sys_admin`
if [ "$SYS_ADMIN" = "" ]; then
export CARBONE_CHROME_FLAGS="--no-sandbox"
echo "Running Chrome without sandbox"
else
echo "Running Chrome with sandbox"
fi
fi
exec ./carbone-ee-linux $@