Remove bash dependency
Depending on bash wasn't strictly necessary, as the two minimal scripts in the repo were both nearly POSIX anyways. Aside from simplifying the repo's dependencies a little bit, this also helps reduce the overall Docker image size as an added bonus.main
parent
2e3c647591
commit
9cbd7bd9d3
11
Dockerfile
11
Dockerfile
|
@ -14,9 +14,11 @@ RUN pip install --prefix /install --no-warn-script-location --no-cache-dir -r re
|
||||||
|
|
||||||
FROM python:3.8-alpine
|
FROM python:3.8-alpine
|
||||||
|
|
||||||
RUN apk add --update --no-cache tor curl bash openrc
|
RUN apk add --update --no-cache tor curl openrc
|
||||||
# libcurl4-openssl-dev
|
# libcurl4-openssl-dev
|
||||||
|
|
||||||
|
RUN apk -U upgrade
|
||||||
|
|
||||||
ARG DOCKER_USER=whoogle
|
ARG DOCKER_USER=whoogle
|
||||||
ARG DOCKER_USERID=927
|
ARG DOCKER_USERID=927
|
||||||
ARG config_dir=/config
|
ARG config_dir=/config
|
||||||
|
@ -69,14 +71,15 @@ COPY app/ app/
|
||||||
COPY run .
|
COPY run .
|
||||||
#COPY whoogle.env .
|
#COPY whoogle.env .
|
||||||
|
|
||||||
# Allow writing symlinks to build dir
|
|
||||||
RUN chown 102:102 app/static/build
|
|
||||||
|
|
||||||
# Create user/group to run as
|
# Create user/group to run as
|
||||||
RUN adduser -D -g $DOCKER_USERID -u $DOCKER_USERID $DOCKER_USER
|
RUN adduser -D -g $DOCKER_USERID -u $DOCKER_USERID $DOCKER_USER
|
||||||
|
|
||||||
# Fix ownership / permissions
|
# Fix ownership / permissions
|
||||||
RUN chown -R ${DOCKER_USER}:${DOCKER_USER} /whoogle /var/lib/tor
|
RUN chown -R ${DOCKER_USER}:${DOCKER_USER} /whoogle /var/lib/tor
|
||||||
|
|
||||||
|
# Allow writing symlinks to build dir
|
||||||
|
RUN chown $DOCKER_USERID:$DOCKER_USERID app/static/build
|
||||||
|
|
||||||
USER $DOCKER_USER:$DOCKER_USER
|
USER $DOCKER_USER:$DOCKER_USER
|
||||||
|
|
||||||
EXPOSE $EXPOSE_PORT
|
EXPOSE $EXPOSE_PORT
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
if [ "$(whoami)" != "root" ]; then
|
if [ "$(whoami)" != "root" ]; then
|
||||||
tor -f /etc/tor/torrc
|
tor -f /etc/tor/torrc
|
||||||
|
|
8
run
8
run
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./run # Runs the full web app
|
# ./run # Runs the full web app
|
||||||
# ./run test # Runs the testing suite
|
# ./run test # Runs the testing suite
|
||||||
|
|
||||||
set -euo pipefail
|
set -eu
|
||||||
|
|
||||||
SCRIPT_DIR="$(builtin cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
SCRIPT_DIR="$(CDPATH= command cd -- "$(dirname -- "$0")" && pwd -P)"
|
||||||
|
|
||||||
# Set directory to serve static content from
|
# Set directory to serve static content from
|
||||||
SUBDIR="${1:-app}"
|
SUBDIR="${1:-app}"
|
||||||
|
@ -17,7 +17,7 @@ rm -f "$SCRIPT_DIR"/app/static/build/*.js
|
||||||
rm -f "$SCRIPT_DIR"/app/static/build/*.css
|
rm -f "$SCRIPT_DIR"/app/static/build/*.css
|
||||||
|
|
||||||
# Check for regular vs test run
|
# Check for regular vs test run
|
||||||
if [[ "$SUBDIR" == "test" ]]; then
|
if [ "$SUBDIR" = "test" ]; then
|
||||||
# Set up static files for testing
|
# Set up static files for testing
|
||||||
rm -rf "$STATIC_FOLDER"
|
rm -rf "$STATIC_FOLDER"
|
||||||
ln -s "$SCRIPT_DIR/app/static" "$STATIC_FOLDER"
|
ln -s "$SCRIPT_DIR/app/static" "$STATIC_FOLDER"
|
||||||
|
|
Loading…
Reference in New Issue