Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
portal-backend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HBP Medical Informatics Platform
portal-backend
Commits
e3496f57
Commit
e3496f57
authored
8 years ago
by
Ludovic Claude
Browse files
Options
Downloads
Patches
Plain Diff
Docker container: Wait for database
parent
de51ae1d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+12
-7
12 additions, 7 deletions
Dockerfile
docker/runner/README.md
+1
-0
1 addition, 0 deletions
docker/runner/README.md
docker/runner/run.sh
+7
-0
7 additions, 0 deletions
docker/runner/run.sh
with
20 additions
and
7 deletions
Dockerfile
+
12
−
7
View file @
e3496f57
...
...
@@ -2,14 +2,19 @@ FROM java:openjdk-8u92-jdk-alpine
MAINTAINER
mirco.nasuti@chuv.ch
RUN
apk add
--update
ca-certificates wget
&&
rm
-rf
/var/cache/apk/
*
/tmp/
*
&&
update-ca-certificates
RUN
wget https://github.com/jwilder/dockerize/releases/download/v0.2.0/dockerize-linux-amd64-v0.2.0.tar.gz
RUN
tar
-C
/usr/local/bin
-xvzf
dockerize-linux-amd64-v0.2.0.tar.gz
ENV
DOCKERIZE_VERSION=v0.2.0
COPY
./docker/runner/config/application.tmpl /config/application.tmpl
COPY
./docker/runner/README.md /
COPY
./target/portal-backend-DOCKER_BUILD.jar backend.jar
RUN
apk add
--update
ca-certificates wget
\
&&
rm
-rf
/var/cache/apk/
*
/tmp/
*
\
&&
update-ca-certificates
\
&&
wget
-O
/tmp/dockerize.tar.gz https://github.com/jwilder/dockerize/releases/download/
$DOCKERIZE_VERSION
/dockerize-linux-amd64-
${
DOCKERIZE_VERSION
}
.tar.gz
\
&&
tar
-C
/usr/local/bin
-xzvf
/tmp/dockerize.tar.gz
\
&&
rm
-rf
/tmp/dockerize.tar.gz
COPY
docker/runner/config/application.tmpl /config/application.tmpl
COPY
docker/runner/README.md docker/runner/run.sh /
COPY
target/portal-backend-DOCKER_BUILD.jar backend.jar
EXPOSE
8080
CMD
["
dockerize", "-template", "/config/application.tmpl:/config/application.yml", "java", "-jar", "backend.jar
"]
CMD
["
./run.sh
"]
This diff is collapsed.
Click to expand it.
docker/runner/README.md
+
1
−
0
View file @
e3496f57
...
...
@@ -10,6 +10,7 @@ You need to configure a few things using some environment variables.
Environment variables:
*
DB_URL: JDBC URL to connect to the database, for example "jdbc:postgresql://db:5432/portal"
*
DB_SERVER: optional, address of the database server, for example DB_SERVER="db:5432". Used to wait for the database to be up and running.
*
DB_USER: User to use when connecting to the database
*
DB_PASSWORD: Password to use when connecting to the database
*
CONTEXT_PATH: context path appended to all services running in this container. Default to "/services"
...
...
This diff is collapsed.
Click to expand it.
docker/runner/run.sh
0 → 100755
+
7
−
0
View file @
e3496f57
#!/bin/sh
OPTS
=
"-template /config/application.tmpl:/config/application.yml"
if
[
!
-z
"
$DB_SERVER
"
]
;
then
OPTS
=
"
$OPTS
-wait
$DB_SERVER
-timeout 60s"
fi
dockerize
$OPTS
java
-jar
backend.jar
This diff is collapsed.
Click to expand it.
Preview
0%
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