Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
Dockerfiles
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Picasoft
Technique
Dockerfiles
Commits
9a90faf2
Verified
Commit
9a90faf2
authored
Sep 23, 2020
by
Quentin Duchemin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MapCareTech] Add superuser, split volumes, add init-like process
parent
f26b89d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
17 deletions
+23
-17
caretech/map/Dockerfile
caretech/map/Dockerfile
+3
-4
caretech/map/docker-compose.yml
caretech/map/docker-compose.yml
+7
-3
caretech/map/entrypoint.sh
caretech/map/entrypoint.sh
+13
-10
No files found.
caretech/map/Dockerfile
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
...
...
caretech/map/docker-compose.yml
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`)
...
...
caretech/map/entrypoint.sh
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 wait for the database
echo
"Wait for the database..."
wait_for_database
# then migrate the database
echo
"Migrate the database..."
umap migrate
# then collect static files
echo
"Collect static files..."
umap collectstatic
--noinput
# create languagae files
echo
"Create language files..."
umap storagei18n
# compress static files
echo
"Compress static files..."
umap compress
# run uWSGI
exec
uwsgi
--ini
uwsgi.ini
echo
"Create superuser..."
umap createsuperuser
echo
"Launch uMap..."
exec
$@
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment