-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile-node-dev
More file actions
52 lines (40 loc) · 1.78 KB
/
Dockerfile-node-dev
File metadata and controls
52 lines (40 loc) · 1.78 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
# This version of the node dockerfile includes the SurrealDB CLI utilities, and includes initialization for surrealdb
FROM condaforge/miniforge3:24.9.2-0
WORKDIR /app
COPY . .
# use bash instead of sh
SHELL ["/bin/bash", "-c"]
# install deps
RUN apt-get update
RUN apt-get install gcc curl git libpq-dev -y
# add conda install to path; use base environment
ENV PATH="/opt/conda/bin:${PATH}"
RUN conda create -y -n node python=3.12
RUN echo "source activate node" > /root/.bashrc
ENV PATH="/opt/conda/envs/node/bin:$PATH"
# install postgres (required for building psycopg2 from source)
RUN conda install -y conda-forge::postgresql=17.2
ENV LDFLAGS="-L/opt/conda/lib"
ENV CPPFLAGS="-I/opt/conda/include"
# Install uv properly and add to PATH
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}"
# Create virtual environment with uv
RUN uv venv .venv
# Install pip explicitly in the virtual environment
RUN curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
.venv/bin/python get-pip.py && \
rm get-pip.py
# Install dependencies with uv
RUN . .venv/bin/activate && \
uv pip install -e .
# install surrealDB so that we have the command line tool
RUN curl -sSf https://install.surrealdb.com | sh
EXPOSE 7001 7002
# run db migrations / config & server
CMD (uv run -m node.storage.db.init_db | tee /dev/stdout) && \
(uv run -m node.storage.hub.init_hub | tee /dev/stdout) && \
(uv run -m node.storage.hub.init_hub --user | tee /dev/stdout) && \
((uv run -m celery -A node.worker.main:app worker --loglevel=info | tee /dev/stdout) & ) && \
(uv run -m node.server.server --communication-protocol http --port 7001 | tee /dev/stdout) & \
uv run -m node.server.server --communication-protocol ws --port 7002 | tee /dev/stdout