Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-apps
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
ghsc
National Seismic Hazard Model Project
nshmp-apps
Commits
c4250f2b
Commit
c4250f2b
authored
5 months ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
checnge docker
parent
ab003972
No related branches found
No related tags found
1 merge request
!506
push to container registry
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+16
-5
16 additions, 5 deletions
.gitlab-ci.yml
docs/docker.md
+23
-15
23 additions, 15 deletions
docs/docker.md
with
39 additions
and
20 deletions
.gitlab-ci.yml
+
16
−
5
View file @
c4250f2b
...
...
@@ -100,17 +100,25 @@ default:
for arg in ${DOCKER_BUILD_ARGS}; do
BUILD_ARGS="${BUILD_ARGS} --build-arg ${arg}";
done
-
env_image_name="${REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${ENVIRONMENT}-latest";
-
latest_image_name="${REGISTRY_IMAGE}/${CI_PROJECT_NAME}:latest";
-
sha_image_name="${REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${IMAGE_TAG}";
-
|
docker build \
${BUILD_ARGS} \
--pull \
--tag "${
REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${IMAGE_TAG
}" \
--tag "${
env_image_name
}" \
--file "${CI_PROJECT_DIR}/${DOCKERFILE}" \
"${CI_PROJECT_DIR}/.";
-
docker push "${REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${IMAGE_TAG}";
-
latest_image_name="${REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${ENVIRONMENT}-latest";
-
docker tag "${REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${IMAGE_TAG}" "${latest_image_name}";
-
docker push "${latest_image_name}";
-
docker push "${env_image_name}";
-
|
docker tag "${env_image_name}" "${sha_image_name}";
docker push "${sha_image_name}";
-
|
if [[ "${ENVIRONMENT}" != "development" ]]; then
docker tag "${env_image_name}" "${latest_image_name}";
docker push "${latest_image_name}";
fi
-
|
printf "
--------
...
...
@@ -119,6 +127,9 @@ default:
" "${CI_PROJECT_NAME}" "${IMAGE_TAG}";
variables
:
DOCKERFILE
:
Dockerfile
DOCKER_BUILD_ARGS
:
|
BUILD_IMAGE=${CI_REGISTRY}/devops/images/usgs/node:20
FROM_IMAGE=${CI_REGISTRY}/devops/images/usgs/nginx:latest
IMAGE_TAG
:
${ENVIRONMENT}-${CI_COMMIT_SHORT_SHA}
REGISTRY_IMAGE
:
${CI_REGISTRY_IMAGE}
...
...
This diff is collapsed.
Click to expand it.
docs/docker.md
+
23
−
15
View file @
c4250f2b
...
...
@@ -2,8 +2,9 @@
## Local Build
This projects contains a
[
Dockerfile
](
https://code.usgs.gov/ghsc/nshmp/nshmp-apps/-/blob/main/Dockerfile
)
that can be built and
ran.
This projects contains a
[
Dockerfile
](
https://code.usgs.gov/ghsc/nshmp/nshmp-apps/-/blob/main/Dockerfile
)
that can be built and ran.
### Build Docker Image
...
...
@@ -39,28 +40,35 @@ docker run -p 8080:8080 nshmp-apps
## Docker Registry
The
[
nshmp-apps
](
https://hub.docker.com/r/usgs/nshmp-apps
)
Docker image is available from the Dock
er
registry
. There are three main tags to pull
:
_
nshmp-apps
_
is available as a public image from the
[
GitLab registry
](
https://code.usgs.gov/ghsc/nshmp/nshmp-apps/contain
er
_
registry
)
with tags
:
-
latest
-
staging-latest
-
production-latest
-
`latest`
,
`staging-latest`
: Latest updates associated with the
[
main
](
https://code.usgs.gov/ghsc/nshmp/nshmp-apps/-/tree/main
)
branch
-
`production-latest`
: Latest stable release associated with a
[
tag
](
https://code.usgs.gov/ghsc/nshmp/nshmp-apps/-/tags
)
The
`staging-latest`
and
`latest`
refers to the
[
main
](
https://code.usgs.gov/ghsc/nshmp/nshmp-apps/-/tree/main
)
branch and
`production-latest`
refers to the
[
production
](
https://code.usgs.gov/ghsc/nshmp/nshmp-apps/-/tree/production
)
branch.
### Pull Image
### Download Registry Image
To ensure you have the latest _nshmp-apps_ update associated with a specific tag,
always first pull the image from Docker:
```
bash
docker pull usgs/nshmp-apps:production-latest
docker pull code.usgs.gov:5001/ghsc/nshmp/nshmp-apps/nshmp-apps:<tag>
```
> Replace `<tag>` with one of the above tags.
Example:
```
bash
docker pull code.usgs.gov:5001/ghsc/nshmp/nshmp-apps/nshmp-apps:latest
```
### Run Registry Image
```
bash
docker run
-p
8080:8080
usgs/nshmp-apps:production-
latest
docker run
-p
8080:8080
code.usgs.gov:5001/ghsc/nshmp/nshmp-apps/nshmp-apps:
latest
```
## Docker Environment Variables
...
...
@@ -70,7 +78,7 @@ By default the backend web services that nshmp-apps calls use
the
`BASE_SERVICE_URL`
environment variable:
```
bash
docker run
-p
8080:8080
-e
BASE_SERVICE_URL
=
""
usgs/nshmp-apps
docker run
-p
8080:8080
-e
BASE_SERVICE_URL
=
""
code.usgs.gov:5001/ghsc/nshmp/nshmp-apps/nshmp-apps:latest
```
<br>
...
...
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