Reduce Docker image size
* Remove the apt cache after installing * Don't create pip caches * Sync .dockerignore with .gitignore files, except for frontend/out, which is needed for build
This commit is contained in:
Родитель
714d8cc239
Коммит
952125685f
|
@ -1,10 +1,8 @@
|
|||
**/.DS_store
|
||||
.coverage
|
||||
# .gitignore
|
||||
.env
|
||||
.envrc
|
||||
.git
|
||||
extension
|
||||
*.sqlite3
|
||||
node_modules
|
||||
env/
|
||||
__pycache__
|
||||
web-ext-artifacts/
|
||||
|
@ -13,3 +11,38 @@ static/downloads
|
|||
static/css
|
||||
static/scss/libs
|
||||
staticfiles
|
||||
coverage/
|
||||
junit.xml
|
||||
|
||||
# frontend/.gitignore
|
||||
frontend/public/mockServiceWorker.js
|
||||
frontend/node_modules
|
||||
frontend/.pnp
|
||||
frontend/.pnp.js
|
||||
frontend/coverage
|
||||
frontend/.next/
|
||||
# Needed by Docker
|
||||
# frontend/out/
|
||||
frontend/build
|
||||
frontend/.DS_Store
|
||||
frontend/*.pem
|
||||
frontend/npm-debug.log*
|
||||
frontend/yarn-debug.log*
|
||||
frontend/yarn-error.log*
|
||||
frontend/.env.local
|
||||
frontend/.env.development.local
|
||||
frontend/.env.test.local
|
||||
frontend/.env.production.local
|
||||
frontend/.vercel
|
||||
|
||||
# frontend/.husky/_/.gitignore
|
||||
frontend/.husky
|
||||
|
||||
# Other
|
||||
**/.DS_store
|
||||
**/__pycache__
|
||||
.buildpacks
|
||||
.coverage
|
||||
.git
|
||||
.pytest_cache
|
||||
extension
|
||||
|
|
|
@ -20,8 +20,11 @@ ENV CIRCLE_BRANCH=${CIRCLE_BRANCH:-unknown} \
|
|||
CIRCLE_TAG=${CIRCLE_TAG:-unknown} \
|
||||
CIRCLE_SHA1=${CIRCLE_SHA1:-unknown}
|
||||
|
||||
RUN apt-get update && apt-get install -y libpq-dev
|
||||
RUN pip install --upgrade pip
|
||||
RUN set -eux; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends libpq-dev; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN pip install --no-cache --upgrade pip
|
||||
|
||||
RUN groupadd --gid 10001 app && \
|
||||
useradd -g app --uid 10001 --shell /usr/sbin/nologin --create-home --home-dir /app app
|
||||
|
@ -34,7 +37,7 @@ USER app
|
|||
COPY --from=gulp-builder --chown=app /app/static ./static
|
||||
|
||||
COPY --chown=app ./requirements.txt /app/requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
RUN pip install --no-cache -r requirements.txt
|
||||
COPY --chown=app . /app
|
||||
COPY --chown=app .env-dist /app/.env
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче