-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.dev
More file actions
59 lines (48 loc) · 1.69 KB
/
Dockerfile.dev
File metadata and controls
59 lines (48 loc) · 1.69 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Stage 1: Development stage for Python dependencies
FROM python:3.12-slim as dep-stage
# Set up app dir
WORKDIR /tmp
# Copy project files over
COPY ./pyproject.toml ./uv.lock ./
# Install system prereq packages
RUN apt-get update && \
apt-get install -y \
build-essential \
git \
# these are for h5py in sdss_explorer
curl libhdf5-dev pkg-config \
# these are for vaex
gcc g++ libboost-all-dev \
libffi-dev python3-dev libxml2-dev libxslt-dev \
libpq-dev zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Installing uv and then project dependencies
RUN pip install uv
RUN uv venv /app/venv # make venv
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-install-project --no-dev --extra solara
# Stage 2: Development stage for the project
FROM dep-stage as dev-stage
# Copy the main project files over and install
COPY ./ ./
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev --extra solara
# setting environment variables
# these can be manually overridden
ENV MODULE_NAME="valis.wsgi"
ENV VALIS_SOCKET_DIR='/tmp/valis'
ENV VALIS_LOGS_DIR='/tmp'
ENV VALIS_ALLOW_ORIGIN="http://localhost:3000"
ENV VALIS_DB_REMOTE=True
ENV VALIS_ENV="development"
ENV SOLARA_CHECK_HOOKS="off"
# Stage 3: Build stage (inherits from dev-stage)
FROM dev-stage as build-stage
# Set a label
LABEL org.opencontainers.image.source https://github.com/sdss/valis
LABEL org.opencontainers.image.description "valis development image"
# Expose port 8000
EXPOSE 8000
# Start the FastAPI app with hot-reloading for development
CMD ["uvicorn", "valis.wsgi:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]