-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from OVINC-CN/chore_build
chore(build): shrink image size
- Loading branch information
Showing
9 changed files
with
46 additions
and
31 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
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
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 |
---|---|---|
|
@@ -5,6 +5,9 @@ | |
env | ||
.env | ||
|
||
# Trasnlation | ||
*.mo | ||
|
||
# Python | ||
*.pyc | ||
*.db | ||
|
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,5 +1,16 @@ | ||
FROM python:3.10 | ||
RUN mkdir -p /usr/src/app/celery-logs /usr/src/app/logs /usr/src/app/daphne-logs | ||
COPY . /usr/src/app | ||
FROM python:3.10.15-slim | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY requirements.txt /usr/src/app/ | ||
RUN pip3 install -U pip && pip3 install -r requirements.txt | ||
|
||
COPY . /usr/src/app | ||
|
||
RUN export https_proxy=http://10.1.0.163:6152 && export http_proxy=http://10.1.0.163:6152 && export all_proxy=socks5://10.1.0.163:6153 && apt-get update && apt-get install -y gettext | ||
|
||
RUN cp env.example .env \ | ||
&& python3 manage.py compilemessages -l zh_Hans \ | ||
&& rm -rf .env | ||
|
||
RUN mkdir -p /usr/src/app/celery-logs /usr/src/app/logs /usr/src/app/daphne-logs |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pylint: | ||
scripts/pylint.sh | ||
|
||
pre-commit: | ||
scripts/pre-commit.sh | ||
|
||
lint: pre-commit pylint |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
APP_CODE=union-api | ||
APP_SECRET=union-api | ||
BACKEND_URL=https://dev-api.example.com | ||
BACKEND_HOST=dev-api.example.com | ||
FRONTEND_URL=https://dev.example.com | ||
DB_NAME=union-api | ||
DB_USER=union-api | ||
DB_PASSWORD= | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
REDIS_HOST=127.0.0.1 | ||
REDIS_PORT=6379 | ||
REDIS_PASSWORD= | ||
REDIS_DB=0 | ||
OVINC_API_DOMAIN=https://api.example.com | ||
OVINC_WEB_URL=https://www.example.com |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
pre-commit run -a |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
pylint --disable=C0114,W0613,C0115,W1113,W0223,C0116,R0901,R0903,C0209 --max-line-length=120 $(git ls-files '*.py') |