Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Software Heritage virtual environment packaging manifests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Infrastructure
Software Heritage virtual environment packaging manifests
Commits
038eb88e
Unverified
Commit
038eb88e
authored
2 months ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
counters: Install python dependencies faster
parent
3156ddbd
No related branches found
Branches containing commit
Tags
swh-loader-highpriority-20220926.1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/swh-counters/Dockerfile
+21
-14
21 additions, 14 deletions
apps/swh-counters/Dockerfile
with
21 additions
and
14 deletions
apps/swh-counters/Dockerfile
+
21
−
14
View file @
038eb88e
# Deeply inspired from the Dockerfile of the swh-storage project
FROM
python:3.10-bullseye
ARG
userid=1000
ARG
groupid=1000
ARG
user=swh
ARG
workdir=/opt/${user}
ARG
venv=${workdir}/venv
ARG
configdir=/etc/${user}
# retry command is used by the refresh-history cron job
# to ensure the rpc service is well up
RUN
apt-get
-y
update
&&
\
apt-get
-y
upgrade
&&
\
apt-get
install
-y
libcmph-dev librdkafka-dev retry
&&
\
apt clean
&&
\
addgroup
--gid
1000 swh
&&
\
useradd
--gid
1000
--uid
1000
-m
-d
/opt/swh swh
&&
\
mkdir
/etc/swh
USER
swh
WORKDIR
/opt/swh
addgroup
--gid
${
userid
}
${
user
}
&&
\
useradd
--gid
${
groupid
}
--uid
${
userid
}
-m
-d
${
workdir
}
${
user
}
&&
\
mkdir
${
configdir
}
COPY
--chown=swh:swh requirements-frozen.txt /opt/swh
USER
${user}
RUN
python
-m
venv
${
venv
}
WORKDIR
${workdir}
ENV
PYTHONPATH=
/opt/swh
ENV
PATH=
/opt/swh/.local
/bin:$PATH
ENV
PYTHONPATH=
${venv}
ENV
PATH=
${venv}
/bin:$PATH
RUN
/usr/local/bin/python
-m
pip
install
--upgrade
pip
&&
\
pip
install
--no-cache-dir
-r
requirements-frozen.txt
RUN
python
-m
pip
install
uv
COPY
--chown=${userid}:${groupid} requirements-frozen.txt ${workdir}
RUN
uv pip
sync
--no-cache
requirements-frozen.txt
COPY
--chown=
swh:swh
entrypoint.sh
/opt/swh
RUN
chmod
u+x
/opt/swh
/entrypoint.sh
COPY
--chown=
${userid}:${groupid}
entrypoint.sh
${workdir}
RUN
chmod
u+x
${
workdir
}
/entrypoint.sh
ENV
SWH_CONFIG_FILENAME=
/etc/swh
/config.yml
ENV
SWH_CONFIG_FILENAME=
${configdir}
/config.yml
ENV
PORT 5011
EXPOSE
$PORT
ENV
THREADS 2
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment