Skip to content

Commit

Permalink
Add non-root user
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed May 28, 2024
1 parent d2ca202 commit c90ffe0
Showing 1 changed file with 60 additions and 31 deletions.
91 changes: 60 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,66 @@
FROM continuumio/miniconda3

# Set working directory
WORKDIR /home
RUN mkdir /home/bin && \
cd /home/bin && wget https://dl.min.io/server/minio/release/linux-amd64/minio && \

# Install MinIO server and client
RUN mkdir -p /home/bin && \
cd /home/bin && \
wget https://dl.min.io/server/minio/release/linux-amd64/minio && \
wget https://dl.min.io/client/mc/release/linux-amd64/mc && \
chmod +x /home/bin/minio /home/bin/mc && \
chmod -R 777 /home
RUN mkdir /.mc && \

# Create and set permissions for .mc directory
RUN mkdir -p /.mc && \
chmod -R 777 /.mc
RUN apt-get update && apt-get install -y --no-install-recommends \
fonts-liberation\
libasound2\
libatk-bridge2.0-0\
libatk1.0-0\
libatspi2.0-0\
libcairo2\
libcups2\
libdbus-1-3\
libdrm2\
libgbm1\
libglib2.0-0\
libgtk-3-0\
libnspr4\
libnss3\
libpango-1.0-0\
libx11-6\
libxcb1\
libxcomposite1\
libxdamage1\
libxext6\
libxfixes3\
libxrandr2
RUN conda update pip -y

# Install necessary packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libatspi2.0-0 \
libcairo2 \
libcups2 \
libdbus-1-3 \
libdrm2 \
libgbm1 \
libglib2.0-0 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libpango-1.0-0 \
libx11-6 \
libxcb1 \
libxcomposite1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxrandr2 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Update conda and install dependencies
RUN conda update -n base -c defaults conda -y && \
conda install pip -y

# Copy all files to the container
ADD . .
RUN pip install .[server-apps]
# RUN pip install --no-cache-dir .
RUN pip install --no-cache-dir playwright && playwright install
EXPOSE 3000

# Install Python dependencies
RUN pip install .[server-apps] --no-cache-dir && \
pip install playwright --no-cache-dir && \
playwright install

# Add user and switch to non-root user
RUN useradd -u 8877 hypha
USER hypha

# Expose port
EXPOSE 9520

# Define the command to run the application
CMD ["python", "-m", "hypha.server", "--host=0.0.0.0", "--port=9520"]

0 comments on commit c90ffe0

Please sign in to comment.