Skip to content

Commit

Permalink
remove entrypoint as its causing issues. set default puid/pgid. (#47)
Browse files Browse the repository at this point in the history
Co-authored-by: Spoked <Spoked@localhost>
  • Loading branch information
dreulavelle and Spoked authored Dec 17, 2023
1 parent a4e6f4c commit 750822d
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,44 @@ 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 shadow \
vim nano curl \
rclone && \
# Define environment variables for PUID and PGID
ENV PUID=1000
ENV PGID=1000

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

# Install pnpm
RUN npm install -g pnpm

# Set the working directory
WORKDIR /iceberg

# Copy the application files
COPY . /iceberg/
COPY entrypoint.sh /usr/local/bin/entrypoint.sh

# Set up Python virtual environment and install dependencies
RUN python3 -m venv /venv && \
source /venv/bin/activate && \
pip3 install --no-cache-dir -r /iceberg/requirements.txt
pip install --no-cache-dir -r requirements.txt

RUN cd /iceberg/frontend && \
# Build the frontend
RUN cd frontend && \
pnpm install && \
pnpm run build

# Create user and group for the application
RUN addgroup -g ${PGID} iceberg && \
adduser -D -u ${PUID} -G iceberg iceberg && \
chown -R iceberg:iceberg /iceberg

# Switch to the new user
USER iceberg

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

# 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
cd /iceberg/frontend && pnpm run preview --host 0.0.0.0 >/dev/null 2>&1

0 comments on commit 750822d

Please sign in to comment.