Skip to content

Commit

Permalink
fix docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Dec 6, 2018
1 parent 0e9de37 commit 6427aa0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
35 changes: 12 additions & 23 deletions Dockerfile
@@ -1,36 +1,25 @@

# Python support can be specified down to the minor or micro version
# (e.g. 3.6 or 3.6.3).
# OS Support also exists for jessie & stretch (slim and full).
# See https://hub.docker.com/r/library/python/ for all supported Python
# tags from Docker Hub.
# This image uses the latest version of Python 3.6
FROM python:3.6-slim-stretch
FROM python:3.6-slim

LABEL Name=sspanel Version=0.0.1
LABEL Name=django-sspanel Version=0.0.2

COPY . /src/django-sspanel

WORKDIR /src/django-sspanel

RUN apt-get update -qq && \
apt-get install -qq -y --no-install-recommends \
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
python3-dev \
default-libmysqlclient-dev && \
pip install --no-cache-dir -r requirements.txt && \
apt-get purge -qq -y build-essential python3-dev && \
apt-get autoremove -qq -y --purge && \
rm -rf /var/cache/apt /var/lib/apt/lists && \
python3 manage.py collectstatic --no-input && \
groupadd -g 555 app && \
useradd -r -u 555 -g app app && \
chown -R a`pp:app /src

USER app
pip install --no-cache-dir -r requirements.txt

EXPOSE 8080

CMD python3 manage.py makemigrations && \
python3 manage.py migrate --run-syncdb && \
uwsgi uwsgi.ini
# 如果是第一次运行需要手动exec进去执行如下命令
# python3 manage.py collectstatic --no-input && \
# python3 manage.py makemigrations && \
# python3 manage.py migrate --run-syncdb && \

# server
CMD uwsgi uwsgi.ini
2 changes: 1 addition & 1 deletion configs/default/sites.py
Expand Up @@ -27,7 +27,7 @@
MAX_CHECKIN_TRAFFIC = 200 * MB

# 是否启用支付宝系统
USE_ALIPAY = True
USE_ALIPAY = False
# 支付订单提示信息 修改请保留 {} 用于动态生成金额
ALIPAY_TRADE_INFO = '谜之屋的{}元充值码'

Expand Down

0 comments on commit 6427aa0

Please sign in to comment.