-
Notifications
You must be signed in to change notification settings - Fork 45
/
Dockerfile.app-sre
36 lines (29 loc) · 1.16 KB
/
Dockerfile.app-sre
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
FROM quay.io/app-sre/fabric8-analytics-f8a-worker-base:aa8893d
ENV LANG=en_US.UTF-8 \
# place where to download & unpack artifacts
WORKER_DATA_DIR='/var/lib/f8a_worker/worker_data' \
# home directory
HOME='/workdir' \
# place for alembic migrations
ALEMBIC_DIR='/alembic'
# Make sure random user has place to store files
RUN mkdir -p ${HOME} ${WORKER_DATA_DIR} ${ALEMBIC_DIR}/alembic/ && \
chmod 777 ${HOME} ${WORKER_DATA_DIR}
WORKDIR ${HOME}
COPY requirements.txt /tmp/f8a_worker/
# Install google.protobuf from source
# https://github.com/fabric8-analytics/fabric8-analytics-worker/issues/261
# https://github.com/google/protobuf/issues/1296
RUN cd /tmp/f8a_worker/ && \
pip3 install -r requirements.txt
COPY alembic.ini hack/run-db-migrations.sh ${ALEMBIC_DIR}/
COPY alembic/ ${ALEMBIC_DIR}/alembic
# Install f8a_worker
COPY ./ /tmp/f8a_worker/
RUN cd /tmp/f8a_worker && pip3 install .
COPY hack/worker+pmcd.sh /usr/bin/
EXPOSE 44321
CMD ["/usr/bin/worker+pmcd.sh"]
# Make sure there are no root-owned files and directories in the home directory,
# as this directory can be used by non-root user at runtime.
RUN find ${HOME} -mindepth 1 -delete