Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
13 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters