Borek Požár
1937f3a4c9
Vyrobeno nové `mamweb/settings_docker.py` jako kříženec mezi `_local` a `_test`. Úměrně tomu upraveno `mamweb/settings.py`, aby ho používalo při volání z kontejneru.`docker_entrypoint.sh` počká na start konejneru s Postgresem, zkontroluje existenci testdat (případně je vygeneruje) a spustí command specifikovaný v compose, tedy spustí webserver.
36 lines
No EOL
810 B
Docker
36 lines
No EOL
810 B
Docker
FROM python:3.9.18-slim-bullseye
|
||
|
||
# set work directory
|
||
WORKDIR /usr/mamweb-docker
|
||
|
||
# set environment variables
|
||
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
|
||
ENV PYTHONDONTWRITEBYTECODE 1
|
||
ENV PYTHONUNBUFFERED 1
|
||
|
||
# install dependencies
|
||
RUN apt-get update && apt-get install -y \
|
||
libpq-dev \
|
||
gcc \
|
||
locales \
|
||
imagemagick \
|
||
netcat \
|
||
postgresql-client
|
||
RUN pip install --upgrade pip
|
||
COPY ./requirements.txt .
|
||
COPY ./constraints.txt .
|
||
RUN pip install -r requirements.txt
|
||
|
||
# allow correct locales
|
||
RUN sed -i '/cs_CZ.UTF-8/s/^# //g' /etc/locale.gen && \
|
||
locale-gen
|
||
ENV LANG cs_CZ.UTF-8
|
||
ENV LANGUAGE en_US:en
|
||
ENV LC_ALL cs_CZ.UTF-8
|
||
|
||
# copy project
|
||
COPY . .
|
||
|
||
# create test data once db is ready
|
||
RUN chmod +x /usr/mamweb-docker/docker_entrypoint.sh
|
||
ENTRYPOINT ["/usr/mamweb-docker/docker_entrypoint.sh"] |