Skip to content

Commit

Permalink
Merge pull request #205 from NapthaAI/fix/#204
Browse files Browse the repository at this point in the history
Install postgres in Dockerfile for psycopg2 to build correctly
  • Loading branch information
moarshy authored Feb 16, 2025
2 parents 1fbf846 + 00096f5 commit 88206a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
11 changes: 7 additions & 4 deletions Dockerfile-node
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ SHELL ["/bin/bash", "-c"]

# install deps
RUN apt-get update
RUN apt-get install curl gcc curl git -y
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 -n node python=3.12
RUN conda create -y -n node python=3.12
RUN echo "source activate node" > /root/.bashrc
ENV PATH="/opt/conda/envs/node/bin:$PATH"
RUN echo

# install postgres (required for poetry to build psycopg2 from source)
RUN conda install -y conda-forge::postgresql=17.2
ENV LDFLAGS="-L/opt/conda/lib"
ENV CPPFLAGS="-I/opt/conda/include"

# set up poetry
ENV PATH="/root/.local/share/pypoetry/venv/bin/:${PATH}"
Expand All @@ -40,4 +44,3 @@ CMD set -x && \
((poetry run celery -A node.worker.main:app worker --loglevel=info | tee /dev/stdout) & ) && \
((poetry run python -m node.server.server --communication-protocol http --port 7001) &) && \
poetry run python -m node.server.server --communication-protocol ws --port 7002

10 changes: 7 additions & 3 deletions Dockerfile-node-dev
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ SHELL ["/bin/bash", "-c"]

# install deps
RUN apt-get update
RUN apt-get install curl gcc curl git -y
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 -n node python=3.12
RUN conda create -y -n node python=3.12
RUN echo "source activate node" > /root/.bashrc
ENV PATH="/opt/conda/envs/node/bin:$PATH"
RUN echo

# install postgres (required for poetry to build psycopg2 from source)
RUN conda install -y conda-forge::postgresql=17.2
ENV LDFLAGS="-L/opt/conda/lib"
ENV CPPFLAGS="-I/opt/conda/include"

# set up poetry
ENV PATH="/root/.local/share/pypoetry/venv/bin/:${PATH}"
Expand Down

0 comments on commit 88206a2

Please sign in to comment.