-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
35 lines (23 loc) · 814 Bytes
/
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
FROM python:3.8-buster
ARG version
RUN apt-get update && apt-get install -y cron sudo
COPY requirements.txt /
ENV PYTHONPATH "${PYTHONPATH}:/"
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r /requirements.txt
COPY ./usocial /usocial
COPY ./migrations /usocial/migrations
COPY config.py start.sh /
RUN chmod +x /start.sh
RUN echo "VERSION = '${version}'" >> /config.py \
&& echo "BUILD = '"`date +%Y%m%d`"'" >> /config.py
ENV INSTANCE_PATH=/instance
VOLUME ["/instance"]
RUN groupadd -r usocial --gid=1000 && useradd -r -g usocial --uid=1000 --create-home --shell /bin/bash usocial
RUN touch /var/log/cron.log \
&& chown usocial:usocial /var/log/cron.log \
&& echo 'usocial ALL=NOPASSWD: /usr/sbin/cron' >> /etc/sudoers
USER usocial
WORKDIR /usocial
EXPOSE 5000
CMD [ "/start.sh" ]