Skip to content

Commit

Permalink
fix symlink permission issue (#44)
Browse files Browse the repository at this point in the history
* fix symlink permission issue

* Update readme with permission flags

---------

Co-authored-by: Spoked <Spoked@localhost>
  • Loading branch information
dreulavelle and Spoked authored Dec 17, 2023
1 parent b53dc9d commit 4e61a4f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ LABEL org.label-schema.name="Iceberg" \
org.label-schema.description="Iceberg Debrid Downloader" \
org.label-schema.url="https://github.com/dreulavelle/iceberg"

RUN apk --update add python3 py3-pip nodejs npm bash && \
RUN apk --update add python3 py3-pip nodejs npm bash shadow vim nano rclone && \
rm -rf /var/cache/apk/*

RUN npm install -g pnpm

WORKDIR /iceberg
COPY . /iceberg/
COPY entrypoint.sh /usr/local/bin/entrypoint.sh

RUN python3 -m venv /venv && \
source /venv/bin/activate && \
Expand All @@ -21,5 +22,9 @@ RUN cd /iceberg/frontend && \
pnpm run build

EXPOSE 4173 8080
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

CMD cd /iceberg/frontend && pnpm run preview --host 0.0.0.0 & cd /iceberg/backend && source /venv/bin/activate && exec python main.py
# Start the backend first, then the frontend (suppressed frontend output)
CMD cd /iceberg/backend && source /venv/bin/activate && exec python main.py & \
cd /iceberg/frontend && pnpm run preview --host 0.0.0.0 >/dev/null 2>&1
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ services:
image: spoked/iceberg:latest
container_name: Iceberg
restart: unless-stopped
environment:
- PUID=999
- GUID=999
ports:
- "4173:4173"
volumes:
Expand Down
28 changes: 28 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

set -e
set -u

echo "Starting Iceberg container..."

# Check for required environment variables and validate configuration
# NOTE: This will be used to check for rclone flags and other configuration later
# required_vars=("REQUIRED_VAR1" "REQUIRED_VAR2")
# for var in "${required_vars[@]}"; do
# if [ -z "${!var:-}" ]; then
# echo "Error: Required environment variable '$var' not set."
# exit 1
# fi
# done

PUID=${PUID:-1000}
PGID=${PGID:-1000}

addgroup -g $PGID iceberg
adduser -D -u $PUID -G iceberg iceberg
chown -R iceberg:iceberg /iceberg
chmod -R 755 /iceberg

trap "echo 'Shutting down...'; exit" SIGINT SIGTERM
echo "Initialization complete. Executing main process..."
exec "$@"

0 comments on commit 4e61a4f

Please sign in to comment.