-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.server.alpine
More file actions
74 lines (53 loc) · 1.79 KB
/
Dockerfile.server.alpine
File metadata and controls
74 lines (53 loc) · 1.79 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
71
72
73
74
# Set the base image
FROM alpine-ktools
# Now the OASIAPI parts
RUN apk add --no-cache bash git nginx uwsgi uwsgi-python
RUN apk --no-cache add py-pip
RUN apk --no-cache add py-flask
RUN apk --no-cache add mysql-client
RUN apk --no-cache add py-mysqldb
RUN apk --no-cache add openrc
RUN mkdir /var/www/oasis
RUN mkdir /var/www/oasis/server
RUN mkdir /var/www/oasis/common
RUN mkdir /var/www/oasis/upload
RUN mkdir /var/www/oasis/download
RUN mkdir /var/log/oasis
# application folder
ENV APP_DIR /app
# app dir
RUN mkdir ${APP_DIR} \
&& chown -R nginx:nginx ${APP_DIR} \
&& chmod 777 /run/ -R \
&& chmod 777 /root/ -R
VOLUME [${APP_DIR}]
WORKDIR ${APP_DIR}
COPY ./src/server /var/www/oasis/server/
COPY ./src/oasis_utils /var/www/oasis/oasis_utils/
COPY ./src/common /var/www/oasis/common/
COPY ./src/server/requirements.txt ./
COPY ./src/server/ngxstartup.sh /usr/local/bin
COPY ./utils/wait-for-it.sh /usr/local/bin
RUN chmod +x /usr/local/bin/ngxstartup.sh
RUN chmod +x /usr/local/bin/wait-for-it.sh
RUN touch /var/log/oasis/oasis_api_server.log
RUN chmod a+w /var/log/oasis/oasis_api_server.log
RUN pip install -r ./requirements.txt
RUN apk --no-cache del py-mysqldb
RUN apk --no-cache add mysql-client
RUN rm -rf /var/cache/apk/*
RUN rm -rf /var/cache/misc/*
EXPOSE 80
# copy config files into filesystem
COPY ./ngx/nginx.conf /etc/nginx/nginx.conf
COPY ./ngx/app.ini /app.ini
# COPY ./ngx/entrypoint.sh /entrypoint.sh
COPY ./src/server_config/oasis.wsgi /app/app.py
ENTRYPOINT \
sed -i -e "s/%RABBIT_PORT%/5671/" /var/www/oasis/common/CeleryConfig.py && \
sed -i -e "s/%MYSQL_PORT%/3306/" /var/www/oasis/common/CeleryConfig.py && \
ngxstartup.sh
# tail -f /var/log/oasis/oasis_api_server.log
# ENTRYPOINT ["/entrypoint.sh"]
# Dockerfile author / maintainer
MAINTAINER Ben Matharu <neb@sky.com>