Skip to content

Commit

Permalink
Merge pull request #70 from Shuyib/Shuyib-patch-3
Browse files Browse the repository at this point in the history
Update Dockerfile
  • Loading branch information
Shuyib authored Nov 18, 2024
2 parents 10f436f + 3540e55 commit 52cb31d
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,25 @@ WORKDIR /app
# ensures that the python output is sent to the terminal without buffering
ENV PYTHONUNBUFFERED=TRUE

# Update and upgrade packages, create a virtual environment, activate it and install the required libraries
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
python3 -m venv phylo-env && \
. phylo-env/bin/activate && \
pip --no-cache-dir install --upgrade pip && \
pip --no-cache-dir install --requirement requirements.txt

# Copy the current directory contents into the container at /app
COPY . /app

# create a virtual environment, activate it and install the required libraries
RUN python3 -m venv phylo-env &&\
. phylo-env/bin/activate &&\
pip --no-cache-dir install --upgrade pip &&\
pip --no-cache-dir install --requirement requirements.txt
# Create a non-root user
RUN useradd -m phylo-user && \
chown -R phylo-user:phylo-user /app

# Switch to the non-root user
USER phylo-user

# Make port 8888 available to the world outside this container
EXPOSE 8888
Expand All @@ -28,6 +39,3 @@ VOLUME /app

# Run jupyter when container launches
CMD ["jupyter", "notebook", "--ip='0.0.0.0'", "--port=8888", "--no-browser", "--allow-root"]



0 comments on commit 52cb31d

Please sign in to comment.