mirror of
https://github.com/casjaysdevdocker/tor
synced 2025-01-18 12:34:38 -05:00
🗃️ Committing everything that changed 🗃️
Dockerfile rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/etc/docker/init.d/php.sh rootfs/usr/local/etc/docker/init.d/tor.sh
This commit is contained in:
parent
966239aaee
commit
5fb5fc3044
@ -166,6 +166,7 @@ RUN echo "Running final commands before cleanup"; \
|
|||||||
RUN echo "Deleting unneeded files"; \
|
RUN echo "Deleting unneeded files"; \
|
||||||
$SHELL_OPTS; \
|
$SHELL_OPTS; \
|
||||||
pkmgr clean; \
|
pkmgr clean; \
|
||||||
|
rm -Rf /etc/tor/*.sample || true; \
|
||||||
rm -Rf "/config" "/data" || true; \
|
rm -Rf "/config" "/data" || true; \
|
||||||
rm -rf /etc/systemd/system/*.wants/* || true; \
|
rm -rf /etc/systemd/system/*.wants/* || true; \
|
||||||
rm -rf /lib/systemd/system/systemd-update-utmp* || true; \
|
rm -rf /lib/systemd/system/systemd-update-utmp* || true; \
|
||||||
@ -251,6 +252,5 @@ VOLUME [ "/config","/data" ]
|
|||||||
|
|
||||||
EXPOSE ${SERVICE_PORT} ${ENV_PORTS}
|
EXPOSE ${SERVICE_PORT} ${ENV_PORTS}
|
||||||
|
|
||||||
CMD [ "tail", "-f", "/dev/null" ]
|
|
||||||
ENTRYPOINT [ "tini","--","/usr/local/bin/entrypoint.sh" ]
|
ENTRYPOINT [ "tini","--","/usr/local/bin/entrypoint.sh" ]
|
||||||
HEALTHCHECK --start-period=10m --interval=5m --timeout=15s CMD [ "/usr/local/bin/entrypoint.sh", "healthcheck" ]
|
HEALTHCHECK --start-period=10m --interval=5m --timeout=15s CMD [ "/usr/local/bin/entrypoint.sh", "healthcheck" ]
|
||||||
|
@ -73,23 +73,23 @@ unset set_env
|
|||||||
RUNAS_USER="root" # normally root
|
RUNAS_USER="root" # normally root
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# User and group in which the service switches to - IE: nginx,apache,mysql,postgres
|
# User and group in which the service switches to - IE: nginx,apache,mysql,postgres
|
||||||
SERVICE_USER="tor" # execute command as another user
|
SERVICE_USER="" # execute command as another user
|
||||||
SERVICE_GROUP="tor" # Set the service group
|
SERVICE_GROUP="" # Set the service group
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Set user and group ID
|
# Set user and group ID
|
||||||
SERVICE_UID="0" # set the user id
|
SERVICE_UID="0" # set the user id
|
||||||
SERVICE_GID="0" # set the group id
|
SERVICE_GID="0" # set the group id
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Primary server port- will be added to server ports
|
# Primary server port- will be added to server ports
|
||||||
WEB_SERVER_PORT="" # port : 80,443
|
WEB_SERVER_PORT="$PORT" # port : 80,443
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Secondary ports
|
# Secondary ports
|
||||||
SERVER_PORTS="" # specifiy other ports
|
SERVER_PORTS="" # specifiy other ports
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Healthcheck variables
|
# Healthcheck variables
|
||||||
HEALTH_ENABLED="yes" # enable healthcheck [yes/no]
|
HEALTH_ENABLED="yes" # enable healthcheck [yes/no]
|
||||||
SERVICES_LIST="tini" # comma seperated list of processes for the healthcheck
|
SERVICES_LIST="tini,php,tor" # comma seperated list of processes for the healthcheck
|
||||||
HEALTH_ENDPOINTS="" # url endpoints: [http://localhost/health,http://localhost/test]
|
HEALTH_ENDPOINTS="http://127.0.0.1/health/txt" # url endpoints: [http://localhost/health,http://localhost/test]
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Update path var
|
# Update path var
|
||||||
export PATH RUNAS_USER SERVICE_USER SERVICE_GROUP SERVICE_UID SERVICE_GID WWW_ROOT_DIR DATABASE_DIR
|
export PATH RUNAS_USER SERVICE_USER SERVICE_GROUP SERVICE_UID SERVICE_GID WWW_ROOT_DIR DATABASE_DIR
|
||||||
|
@ -177,7 +177,15 @@ __run_precopy() {
|
|||||||
# Define actions/commands
|
# Define actions/commands
|
||||||
if [ ! -d "$WWW_ROOT_DIR" ] || __is_dir_empty "$WWW_ROOT_DIR"; then
|
if [ ! -d "$WWW_ROOT_DIR" ] || __is_dir_empty "$WWW_ROOT_DIR"; then
|
||||||
mkdir -p "$WWW_ROOT_DIR"
|
mkdir -p "$WWW_ROOT_DIR"
|
||||||
cp -Rfv "/usr/local/share/template-files/data/htdocs/www"/* "$WWW_ROOT_DIR/"
|
cp -Rfv "/usr/share/httpd/default"/* "$WWW_ROOT_DIR/"
|
||||||
|
fi
|
||||||
|
if [ -d "$WWW_ROOT_DIR/.git" ]; then
|
||||||
|
rm -Rf "$WWW_ROOT_DIR/.git"
|
||||||
|
fi
|
||||||
|
if [ ! -d "$WWW_ROOT_DIR/health" ]; then
|
||||||
|
mkdir -p "$WWW_ROOT_DIR/health"
|
||||||
|
echo "200" >"$WWW_ROOT_DIR/health/txt"
|
||||||
|
echo '{"message":"ok"}' >"$WWW_ROOT_DIR/health/json"
|
||||||
fi
|
fi
|
||||||
# allow custom functions
|
# allow custom functions
|
||||||
if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi
|
if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi
|
||||||
|
@ -175,7 +175,7 @@ __run_precopy() {
|
|||||||
# Define environment
|
# Define environment
|
||||||
local hostname=${HOSTNAME}
|
local hostname=${HOSTNAME}
|
||||||
# Define actions/commands
|
# Define actions/commands
|
||||||
|
[ -f "/etc/tor/torrc.sample" ] && rm -Rf "/etc/tor"/*.sample
|
||||||
# allow custom functions
|
# allow custom functions
|
||||||
if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi
|
if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user