Skip to content

Commit 431a08d

Browse files
Merge #394
394: Reduce docker image size r=alallema a=sanders41 # Pull Request With these changes I got ~ a 43% reduction in the final image size (1.55GB to 877MB). Note that depending on your local files present (virtual environments, etc) you may see slightly different numbers with a build, but it will always be significantly smaller. ## Related issue Fixes #<issue_number> ## What does this PR do? - Cleans up the `apt-get install` section - Adds a `.dockerignore` file - Removes the separate install of `pip3`. Because the image is `python:3.10.8-slim-bullseye` `pip` is already included by default ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Paul Sanders <[email protected]>
2 parents 0c35e68 + 356efc6 commit 431a08d

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

.dockerignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Build artifacts
2+
build/
3+
dist/
4+
5+
# Git/GitHub
6+
.git/
7+
.github/
8+
.gitignore
9+
10+
# Python specific files
11+
**/__pycache__
12+
**/.mypy_cache/
13+
**/.pylintrc/
14+
**/.pytest_cache/
15+
**/*.py[cod]
16+
**/*.egg
17+
**/tests/
18+
pytest.ini
19+
tox.ini
20+
21+
# C extensions
22+
*.so
23+
24+
# pyenv
25+
**/.python-version
26+
27+
# Virtual Environments
28+
**/.env
29+
**/.venv
30+
**/env/
31+
**/venv/
32+
33+
# Editors
34+
**/.vscode/
35+
**/.idea/
36+
37+
# Docker
38+
docker-compose.yml
39+
docker-compose.yaml
40+
Dockerfile
41+
42+
# Project files
43+
.editorconfig
44+
bors.toml
45+
CONTRIBUTING.md
46+
README.md
47+
assets/
48+
49+
# System files
50+
.DS_Store

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ ENV LANG C.UTF-8
55

66
WORKDIR /docs-scraper
77

8-
RUN apt-get update -y && apt-get install -y python3-pip libnss3 chromium-driver
8+
RUN : \
9+
&& apt-get update -y \
10+
&& apt-get install -y --no-install-recommends \
11+
libnss3 \
12+
chromium-driver \
13+
&& apt-get clean \
14+
&& rm -rf /var/lib/apt/lists/*
915

10-
RUN pip3 install pipenv
16+
RUN pip install -U pip && pip install pipenv --no-cache-dir
1117

1218
COPY Pipfile Pipfile
1319
COPY Pipfile.lock Pipfile.lock

0 commit comments

Comments
 (0)