You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5 KiB

FROM debian:buster-slim
# todo utiliser image python3 ?
## install dependencies
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y sudo vim nano locales unzip && \
apt-get install -y python-dev python-pip libpq-dev libgeos-dev python3 python3-pip unzip && \
apt-get install -y python3-venv git npm wget postgresql-client && \
localedef -i fr_FR -c -f UTF-8 -A /usr/share/locale/locale.alias fr_FR.UTF-8 && \
apt-get clean
## set envs
ENV LANG fr_FR.utf8
ENV TERM xterm
RUN adduser --uid 1000 --gecos "" --disabled-password appuser
RUN usermod -aG sudo appuser
RUN echo "appuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
COPY vendor/GeoNature-citizen/ /home/appuser/citizen/
# patches
#COPY patches/back/requirements.txt /home/appuser/citizen/backend/requirements.txt #use the requirements from the GnC repo
COPY patches/back/default_config.toml /home/appuser/citizen/config/default_config.toml
COPY patches/settings.ini /home/appuser/citizen/config/settings.ini
COPY patches/back/ /home/appuser/citizen/backend/
COPY patches/back/ /home/appuser/citizen/backend/
RUN chown -R appuser:appuser /home/appuser
USER appuser
WORKDIR /home/appuser/citizen/backend/
ENV VIRTUAL_ENV=/home/appuser/citizen/backend/venv2/
RUN python3 -m venv $VIRTUAL_ENV
# RUN /bin/bash
# Install dependencies:
RUN pip install -r requirements.txt
CMD ["python", " ", "runserver"]