-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
70 lines (56 loc) · 1.62 KB
/
Dockerfile
File metadata and controls
70 lines (56 loc) · 1.62 KB
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
61
62
63
64
65
66
67
68
69
70
FROM python:3.12-alpine
RUN apk update && apk add --no-cache \
build-base \
python3-dev \
postgresql-dev \
musl-dev \
openssl-dev \
libffi-dev \
gcc \
libc-dev \
linux-headers \
openssl-dev \
# (and cargo rustc if you see a Rust error) \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /var/app
RUN mkdir -p \
/var/app/app-data/import/configs/ \
/var/app/app-data/import/files/ \
/var/app/finmars_data \
/var/app/static \
/var/app/app-data/media/ \
/var/log/finmars/workflow/ \
/var/log/celery/ && \
chmod 777 /var/app/finmars_data
#COPY package.json .
#RUN npm install
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache-dir --timeout 120 --retries 10 -r requirements.txt
COPY docs ./docs
COPY finmars_standardized_errors ./finmars_standardized_errors
COPY healthcheck ./healthcheck
COPY logstash ./logstash
COPY workflow_app ./workflow_app
COPY workflow ./workflow
COPY manage.py ./
RUN mkdir ./workflow/static/documentation
RUN mkdocs build --config-file docs/mkdocs.yml --site-dir /var/app/workflow/static/documentation
ENV LC_ALL=C.UTF-8 \
LANG=C.UTF-8
# Node and npm use a non-root user provided by the base Node image
# Creating a new user "finmars" for running the application
RUN adduser \
--disabled-password \
--gecos "" \
finmars
# before switching USER:
RUN chown -R finmars:finmars \
/var/log/finmars \
/var/log/celery \
/var/app \
/var/app/finmars_data
# Change to non-root privilege
USER finmars
EXPOSE 8080
CMD ["gunicorn", "workflow_app.wsgi", "--config", "workflow_app/gunicorn.py"]