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
108cfb10
Commit
108cfb10
authored
5 years ago
by
uroremi
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://gitlab.utc.fr/picasoft/projets/dockerfiles
parents
06f8dc4d
6828cfa5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#58196
passed
5 years ago
Stage: ci-base
Stage: build
Stage: security-tests
Stage: push
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pica-db-backup/postgres-run.sh
+4
-9
4 additions, 9 deletions
pica-db-backup/postgres-run.sh
pica-mattermost/Dockerfile
+1
-1
1 addition, 1 deletion
pica-mattermost/Dockerfile
with
5 additions
and
10 deletions
pica-db-backup/postgres-run.sh
+
4
−
9
View file @
108cfb10
...
...
@@ -10,7 +10,8 @@ BACKUP_FOLDER=${BACKUP_FOLDER:-"/backup/"}
ping
-c
1
-W
1
"
${
POSTGRES_HOST
}
"
||
{
echo
-e
"
\n
===========
${
POSTGRES_HOST
}
not available, skipping backup... ===========
\n
"
;
exit
1
;
}
BACKUP_CMD
=
"pg_dump -w -c >
$BACKUP_FOLDER
"
'${BACKUP_NAME}'
BACKUP_CMD
=
"pg_dump -w -c --format=c >
$BACKUP_FOLDER
"
'${BACKUP_NAME}'
RESTORE_CMD
=
"pg_restore -c
\$
1"
# Make sure backup folder exists
mkdir
-p
"
${
BACKUP_FOLDER
}
"
...
...
@@ -31,13 +32,10 @@ export PGUSER=$POSTGRES_USER
export PGPASSWORD=
$POSTGRES_PASS
DATE=
\$
(date +
\%
Y.
\%
m.
\%
d.
\%
H
\%
M
\%
S)
BACKUP_NAME=
\$
DATE.
sql
BACKUP_NAME=
\$
DATE.
dump
echo "=>
${
POSTGRES_SERVICE_NAME
}
: Backup started:
\$
{BACKUP_NAME}"
if
${
BACKUP_CMD
}
;then
echo " => Compress files
$BACKUP_FOLDER
\$
DATE.tar.gz"
tar -czvf
$BACKUP_FOLDER
\$
DATE.tar.gz
$BACKUP_FOLDER
\$
{BACKUP_NAME} &&
\
rm -rf
$BACKUP_FOLDER
\$
BACKUP_NAME &&
\
echo "
${
POSTGRES_SERVICE_NAME
}
: Backup succeeded"
else
echo "
${
POSTGRES_SERVICE_NAME
}
: Backup failed"
...
...
@@ -64,14 +62,11 @@ export PGUSER=$POSTGRES_USER
export PGPASSWORD=
$POSTGRES_PASS
echo "=>
${
POSTGRES_SERVICE_NAME
}
: Restore database from
\$
1"
tar -xzvf
\$
1
output="
\$
(echo
\$
1 | awk -F'.tar.gz' '{print
\$
1".sql"}')"
if psql <
\$
output ;then
if
${
RESTORE_CMD
}
;then
echo "
${
POSTGRES_SERVICE_NAME
}
: Restore succeeded"
else
echo "
${
POSTGRES_SERVICE_NAME
}
: Restore failed"
fi
rm -Rf
\$
output
EOF
chmod
+x /
$restore_script_name
...
...
This diff is collapsed.
Click to expand it.
pica-mattermost/Dockerfile
+
1
−
1
View file @
108cfb10
...
...
@@ -35,7 +35,7 @@ RUN mkdir -p /mattermost/data /mattermost/plugins /mattermost/client/plugins \
&&
setcap
cap_net_bind_service
=
+ep /mattermost/bin/mattermost
#Healthcheck to make sure container is ready
HEALTHCHECK
--interval=
5m
--timeout=3s CMD curl --fail http://localhost:8000//api/v4/system/ping || exit 1
HEALTHCHECK
--interval=
20s
--timeout=3s CMD curl --fail http://localhost:8000//api/v4/system/ping || exit 1
# Configure entrypoint and command
COPY
entrypoint.sh /
...
...
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