Skip to content

Commit

Permalink
Merge #387: Remove deprecated env vars from container configuration
Browse files Browse the repository at this point in the history
022b74e chore: [#386] remove deprecated container varaibles (Jose Celano)
5b73255 chore: disable shellcheck SC2016 in entryscript (Jose Celano)
fe44afa fix: add missing env var in compose.yaml (Jose Celano)

Pull request description:

  Remove deprecated env vars from container configuration.

ACKs for top commit:
  josecelano:
    ACK 022b74e

Tree-SHA512: 7263cb946d5cc1aaece992942fa7e06157637e7f896ebf985d69bad82e0be9962603b0bc1f0df452d1e44519ea6c4694a3e48003eefde68e23212a43ffd23cce
  • Loading branch information
josecelano committed Nov 15, 2023
2 parents fe73268 + 022b74e commit d769d41
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
8 changes: 1 addition & 7 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,14 @@ COPY --from=gcc --chmod=0555 /usr/local/bin/su-exec /bin/su-exec
ARG TORRUST_INDEX_PATH_CONFIG="/etc/torrust/index/index.toml"
ARG TORRUST_INDEX_DATABASE_DRIVER="sqlite3"
ARG USER_ID=1000
ARG UDP_PORT=6969
ARG HTTP_PORT=7070
ARG API_PORT=1212
ARG API_PORT=3001

ENV TORRUST_INDEX_PATH_CONFIG=${TORRUST_INDEX_PATH_CONFIG}
ENV TORRUST_INDEX_DATABASE_DRIVER=${TORRUST_INDEX_DATABASE_DRIVER}
ENV USER_ID=${USER_ID}
ENV UDP_PORT=${UDP_PORT}
ENV HTTP_PORT=${HTTP_PORT}
ENV API_PORT=${API_PORT}
ENV TZ=Etc/UTC

EXPOSE ${UDP_PORT}/udp
EXPOSE ${HTTP_PORT}/tcp
EXPOSE ${API_PORT}/tcp

RUN mkdir -p /var/lib/torrust/index /var/log/torrust/index /etc/torrust/index
Expand Down
2 changes: 2 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
target: release
tty: true
environment:
- USER_ID=${USER_ID}
- TORRUST_INDEX_CONFIG=${TORRUST_INDEX_CONFIG}
- TORRUST_INDEX_DATABASE_DRIVER=${TORRUST_INDEX_DATABASE_DRIVER:-sqlite3}
- TORRUST_INDEX_TRACKER_API_TOKEN=${TORRUST_INDEX_TRACKER_API_TOKEN:-MyAccessToken}
Expand All @@ -28,6 +29,7 @@ services:
image: torrust/tracker:develop
tty: true
environment:
- USER_ID=${USER_ID}
- TORRUST_TRACKER_CONFIG=${TORRUST_TRACKER_CONFIG}
- TORRUST_TRACKER_DATABASE_DRIVER=${TORRUST_TRACKER_DATABASE_DRIVER:-sqlite3}
- TORRUST_TRACKER_API_ADMIN_TOKEN=${TORRUST_TRACKER_API_ADMIN_TOKEN:-MyAccessToken}
Expand Down
3 changes: 0 additions & 3 deletions contrib/dev-tools/container/build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#!/bin/bash

USER_ID=${USER_ID:-1000}
TORRUST_INDEX_RUN_AS_USER=${TORRUST_INDEX_RUN_AS_USER:-appuser}

echo "Building docker image ..."
echo "USER_ID: $USER_ID"
echo "TORRUST_INDEX_RUN_AS_USER: $TORRUST_INDEX_RUN_AS_USER"

docker build \
--build-arg UID="$USER_ID" \
--build-arg RUN_AS_USER="$TORRUST_INDEX_RUN_AS_USER" \
-t torrust-index .
1 change: 1 addition & 0 deletions contrib/dev-tools/container/e2e/sqlite/e2e-env-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ USER_ID=${USER_ID:-1000} \
TORRUST_TRACKER_DATABASE_DRIVER="sqlite3" \
TORRUST_TRACKER_API_ADMIN_TOKEN="MyAccessToken" \
docker compose up -d

1 change: 1 addition & 0 deletions share/container/entry_script_sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ if [ -e "/usr/share/torrust/container/message" ]; then
fi

# Load message of the day from Profile
# shellcheck disable=SC2016
echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' >> /etc/profile

cd /home/torrust || exit 1
Expand Down

0 comments on commit d769d41

Please sign in to comment.