Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dockerfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Picasoft
Technique
Dockerfiles
Commits
9a90faf2
Verified
Commit
9a90faf2
authored
4 years ago
by
Quentin Duchemin
Browse files
Options
Downloads
Patches
Plain Diff
[MapCareTech] Add superuser, split volumes, add init-like process
parent
f26b89d4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
caretech/map/Dockerfile
+3
-4
3 additions, 4 deletions
caretech/map/Dockerfile
caretech/map/docker-compose.yml
+7
-3
7 additions, 3 deletions
caretech/map/docker-compose.yml
caretech/map/entrypoint.sh
+13
-10
13 additions, 10 deletions
caretech/map/entrypoint.sh
with
23 additions
and
17 deletions
caretech/map/Dockerfile
+
3
−
4
View file @
9a90faf2
...
...
@@ -7,8 +7,7 @@ ENV PYTHONUNBUFFERED=1 \
PORT=8000
# Create a user account and group to run uMap
RUN
mkdir
-p
/srv/umap/
{
data,uploads
}
&&
\
chown
-R
10001:10001 /srv/umap
&&
\
RUN
mkdir
-p
/srv/umap/static /srv/umap/uploads
&&
\
groupadd
--gid
10001 umap
&&
\
useradd
--no-create-home
--uid
10001
--gid
10001
--home-dir
/srv/umap umap
...
...
@@ -45,11 +44,11 @@ RUN pip install umap-project==${UMAP_VERSION}
# Install Docker dependencies
RUN
pip
install
-r
requirements-docker.txt
COPY
entrypoint.sh .
COPY
settings.py .
COPY
entrypoint.sh .
RUN
chmod
+x entrypoint.sh
RUN
chown
-R
umap:
umap
.
RUN
chown
-R
10001:10001 /srv/
umap
USER
umap
...
...
This diff is collapsed.
Click to expand it.
caretech/map/docker-compose.yml
+
7
−
3
View file @
9a90faf2
version
:
'
3.7'
volumes
:
app
:
name
:
umap-caretech
app_static
:
name
:
umap-caretech-static
app_uploads
:
name
:
umap-caretech-uploads
db
:
name
:
umap-db-caretech
redis
:
...
...
@@ -26,7 +28,9 @@ services:
# Do not allow non-authenticated users to create maps
-
LEAFLET_STORAGE_ALLOW_ANONYMOUS=False
volumes
:
-
app:/srv/umap
-
app_static:/srv/umap/static
-
app_uploads:/srv/umap/uploads
init
:
true
labels
:
traefik.http.routers.etherpad-app.entrypoints
:
websecure
traefik.http.routers.etherpad-app.rule
:
Host(`carte.caretech.picasoft.net`)
...
...
This diff is collapsed.
Click to expand it.
caretech/map/entrypoint.sh
+
13
−
10
View file @
9a90faf2
...
...
@@ -5,27 +5,30 @@ set -eo pipefail
:
"
${
SLEEP
:
=1
}
"
:
"
${
TRIES
:
=60
}
"
function
wait_for_database
{
(
function
wait_for_database
{
echo
"Waiting for database to respond..."
tries
=
0
while
true
;
do
[[
$tries
-lt
$TRIES
]]
||
return
(
echo
"from django.db import connection; connection.connect()"
| umap shell
)
>
/dev/null 2>&1
(
echo
"from django.db import connection; connection.connect()"
| umap shell
)
[[
$?
-eq
0
]]
&&
return
sleep
$SLEEP
tries
=
$((
tries
+
1
))
done
)
}
}
# first w
ait for the database
echo
"W
ait for the database
..."
wait_for_database
# then m
igrate the database
echo
"M
igrate the database
..."
umap migrate
# then c
ollect static files
echo
"C
ollect static files
..."
umap collectstatic
--noinput
# c
reate languag
a
e files
echo
"C
reate language files
..."
umap storagei18n
# c
ompress static files
echo
"C
ompress static files
..."
umap compress
# run uWSGI
exec
uwsgi
--ini
uwsgi.ini
echo
"Create superuser..."
umap createsuperuser
echo
"Launch uMap..."
exec
$@
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