-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
60 lines (51 loc) · 1.83 KB
/
Dockerfile
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
53
54
55
56
57
58
59
60
ARG python_image=python:3.10
FROM ${python_image}
RUN apt-get update -qq && \
apt-get install -y libpq-dev mariadb-client
ARG userid=999
ARG groupid=999
ARG project_root=/project
ARG log_path=$project_root/logs
ARG media_path=$project_root/media
ARG workdir_path=$project_root/catalog-api
ARG wait_for_it_path=$project_root/wait-for-it
RUN groupadd -o --gid $groupid hostgroup && \
useradd --no-log-init --uid $userid --gid $groupid appuser
RUN mkdir -p $workdir_path \
$log_path \
$media_path \
/tmp/requirements && \
chown -R appuser:hostgroup /project
WORKDIR $workdir_path
RUN git clone https://github.com/vishnubob/wait-for-it.git $wait_for_it_path
COPY requirements/* /tmp/requirements/
RUN pip install -r /tmp/requirements/requirements-base.txt \
-r /tmp/requirements/requirements-dev.txt \
-r /tmp/requirements/requirements-tests.txt; \
rm /tmp/requirements/*; \
rmdir /tmp/requirements
ENV PYTHONPATH=$workdir_path \
LOG_FILE_DIR=$log_path \
MEDIA_ROOT=$media_path \
PATH=$PATH:$wait_for_it_path \
DEFAULT_DB_HOST=default-db-dev \
DEFAULT_DB_PORT=3306 \
TEST_DEFAULT_DB_HOST=default-db-test \
TEST_DEFAULT_DB_PORT=3306 \
TEST_SIERRA_DB_HOST=sierra-db-test \
TEST_SIERRA_DB_PORT=5432 \
SOLR_HOST=solr-dev \
SOLR_PORT=8983 \
TEST_SOLR_HOST_FOR_UPDATE=solr-test-for-update \
TEST_SOLR_HOST_FOR_SEARCH=solr-test-for-search \
TEST_SOLR_PORT_FOR_UPDATE=8983 \
TEST_SOLR_PORT_FOR_SEARCH=8983 \
REDIS_CELERY_HOST=redis-celery-dev \
REDIS_CELERY_PORT=6379 \
REDIS_APPDATA_HOST=redis-appdata-dev \
REDIS_APPDATA_PORT=6379 \
TEST_REDIS_CELERY_HOST=redis-celery-test \
TEST_REDIS_CELERY_PORT=6379 \
TEST_REDIS_APPDATA_HOST=redis-appdata-test \
TEST_REDIS_APPDATA_PORT=6379
USER appuser