-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathDockerfile
47 lines (41 loc) · 1.22 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
FROM python:3.8.1-slim
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL "C.UTF-8"
ENV LANG "C.UTF-8"
ENV APP_PATH /opt/automan
# install python
RUN apt-get update && \
apt-get install -y --no-install-recommends \
default-libmysqlclient-dev \
default-mysql-client \
curl \
build-essential \
tk-dev && \
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -y \
nodejs \
yarn && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
pip install --no-cache-dir pipenv
# setup pipenv
COPY automan/Pipfile* /tmp/automan/
WORKDIR /tmp/automan
RUN pipenv install --system --deploy
# setup yarn packages
COPY front/package.json $APP_PATH/front/
WORKDIR $APP_PATH/front
RUN yarn install
# setup frontend environment
COPY front/ $APP_PATH/front/
RUN yarn build
COPY automan/ $APP_PATH/automan/
COPY bin/ $APP_PATH/bin/
WORKDIR $APP_PATH/
ENTRYPOINT ["./bin/docker-entrypoint.sh"]
CMD ["uwsgi", "--ini", "conf/app.ini"]