forked from William-Mou/NTHU_announcement_channel
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
27 lines (23 loc) · 835 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
FROM alpine:latest
# This hack is widely applied to avoid python printing issues in docker containers.
ENV PYTHONUNBUFFERED 1
# Install python3 & pip3
RUN echo "**** install Python ****" && \
apk add --no-cache python3 && \
if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \
\
echo "**** install pip ****" && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --no-cache --upgrade pip setuptools wheel && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi
RUN apk add --update --no-cache g++ gcc libxslt-dev python3-dev
RUN mkdir /code
WORKDIR /code
COPY . /code/
RUN pip install -r requirements.txt
# 新增 .env
RUN cp .env-example .env
# 建立資料表
RUN python3 manage.py migrate
ENTRYPOINT ['python3', 'manage.py', 'runserver']