-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.dev
49 lines (38 loc) · 1.32 KB
/
Dockerfile.dev
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
# Stage 1: Development stage for Python dependencies
FROM python:3.10-slim as dep-stage
# Set up app dir
WORKDIR /tmp
# Copy project files over
COPY ./pyproject.toml ./poetry.lock ./
# Install build-essential package
RUN apt-get update && \
apt-get install -y \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install poetry and project dependencies
RUN pip install poetry && \
poetry config virtualenvs.create false && \
poetry install -E solara --no-root && \
rm -rf ~/.cache
# Stage 2: Development stage for the project
FROM dep-stage as dev-stage
# Copy the main project files over and install
COPY ./ ./
RUN poetry install -E solara --only main
# 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
# 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"]