Files
notifications-api/docker/Dockerfile
Leo Hemsted 1f3785a7a3 add script to run celery from within docker
as a team we primarily develop locally. However, we've been experiencing
issues with pycurl, a subdependency of celery, that is notoriously
difficult to install on mac. On top of the existing issues, we're also
seeing it conflict with pyproj in bizarre ways (where the order of
imports between pyproj and pycurl result in different configurations of
dynamically linked C libraries being loaded.

You are encouraged to attempt to install pycurl locally, following these
instructions: https://github.com/alphagov/notifications-manuals/wiki/Getting-Started#pycurl

However, if you aren't having any luck, you can instead now run celery
in a docker container.

`make run-celery-with-docker`

This will build a container, install the dependencies, and run celery
(with the default of four concurrent workers).

It will pull aws variables from your aws configuration as boto would
normally, and it will attempt to connect to your local database with the
user `postgres`. If your local database is configured differently (for
example, with a different user, or on a different port), then you can
set the SQLALCHEMY_DATABASE_URI locally to override that.
2022-02-01 16:29:08 +00:00

33 lines
719 B
Docker

FROM python:3.9-slim-bullseye as parent
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "Install base packages" && apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
git \
&& echo "Install binary app dependencies" \
&& apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libssl-dev \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/* /tmp/*
RUN pip install --upgrade pip
WORKDIR /home/vcap/app
COPY requirements.txt ./
# RUN useradd celeryuser
RUN \
echo "Installing python dependencies" \
&& pip install -r requirements.txt
COPY app app
COPY run_celery.py .
COPY environment.sh .
COPY Makefile .