-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (30 loc) · 1.46 KB
/
Dockerfile
File metadata and controls
40 lines (30 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Use an official Python runtime as a parent image
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /app
# Update the package list and install non-python tools and dependencies
RUN apt-get update && \
apt-get install -y make git subversion gcc libbz2-dev zlib1g-dev && \
rm -rf /var/lib/apt/lists/*
# Copy just the requirements file into the container; we'll copy the
# rest later so that docker/podman can cache the state of the dependencies first
COPY ./requirements.txt /app/requirements.txt
# Install python dependencies; final chmod is needed to be able to run a non-root
RUN pip install --no-cache-dir -r requirements.txt &&\
pip install git+https://github.com/desihub/desiutil@3.5.0 &&\
pip install git+https://github.com/desihub/desitarget@2.9.0 \
git+https://github.com/desihub/prospect@main \
git+https://github.com/desihub/redrock@0.20.4 \
git+https://github.com/desihub/desispec@inventory &&\
install_redrock_templates
# Copy the current directory contents into the container at /app
COPY . /app
RUN chmod -R o+rX /app
# Make port 5001 available to the world outside this container
EXPOSE 5001
# Location of DESI_ROOT, must be mounted at runtime
ENV DESI_ROOT=/desi
# Location of pre-generated inventory files
ENV DESI_TARGET_INVENTORY_DIR=/inventory
# Run gunicorn server
CMD ["gunicorn", "-b", "0.0.0.0:5001", "-w", "5", "app:app"]