Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Web Hosting EKS - Node.js 22 LTS
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Container Registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OTDI Web Hosting
Container Images
Web Hosting EKS - Node.js 22 LTS
Commits
c959242d
Commit
c959242d
authored
1 week ago
by
Edward Hicks
Browse files
Options
Downloads
Patches
Plain Diff
switch to multistage build
parent
dc134188
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
.gitlab-ci.yml
+1
-18
1 addition, 18 deletions
.gitlab-ci.yml
Dockerfile
+9
-3
9 additions, 3 deletions
Dockerfile
Makefile
+1
-1
1 addition, 1 deletion
Makefile
with
11 additions
and
22 deletions
.gitlab-ci.yml
+
1
−
18
View file @
c959242d
...
...
@@ -11,8 +11,6 @@ stages:
awsauth
:
stage
:
awsauth
image
:
registry.containers.it.osu.edu/cache/gitlab-org/cloud-deploy/aws-base:latest
rules
:
-
!reference
[
.default_rules
,
rules
]
script
:
-
if [ "${AWS_ACCESS_KEY_ID}" = "" ]; then echo "Missing AWS_ACCESS_KEY_ID"; exit 1; fi
-
if [ "${AWS_SECRET_ACCESS_KEY}" = "" ]; then echo "Missing AWS_SECRET_ACCESS_KEY"; exit 1; fi
...
...
@@ -35,8 +33,6 @@ build:
needs
:
-
job
:
awsauth
artifacts
:
true
rules
:
-
!reference
[
.default_rules
,
rules
]
script
:
-
if [ $CI_COMMIT_REF_SLUG = "master" -o $CI_COMMIT_REF_SLUG = "main" ]; then TAG="latest"; fi
-
if [ "$AWS_ECR_TOKEN" != "" ]; then ECRARG="--destination ${AWS_ECR_REGISTRY}/${CI_PROJECT_NAME}:${TAG}"; fi
...
...
@@ -59,7 +55,7 @@ build:
" > /kaniko/.docker/config.json
-
|
/kaniko/executor \
--single-snapshot \
--single-snapshot
--target main
\
--context "${CI_PROJECT_DIR}" \
--git "branch=${CI_COMMIT_REF_SLUG},depth=1,single-branch=true,recurse-submodules=true,shallow-submodules=true" \
--dockerfile "${CI_PROJECT_DIR}/Dockerfile" \
...
...
@@ -71,21 +67,8 @@ build:
dotenv
:
build.env
container_scanning
:
rules
:
-
!reference
[
.default_rules
,
rules
]
dependencies
:
-
build
include
:
-
template
:
Security/Container-Scanning.gitlab-ci.yml
.default_rules
:
rules
:
# - changes:
# - "*.md"
# - ".*ignore"
# - Makefile
# - runlocal.sh
# - merge-from-base.sh
# when: never
-
when
:
always
This diff is collapsed.
Click to expand it.
Dockerfile
+
9
−
3
View file @
c959242d
FROM
docker.io/node:22-bookworm
FROM
docker.io/node:22-bookworm
AS
main
LABEL
maintainer="E. Stuart Hicks <hicks.367@osu.edu>"
EXPOSE
3000
...
...
@@ -44,7 +44,13 @@ RUN sed -E -i 's/^gshadow:(.*)$/gshadow:\1 ldap/' /etc/nsswitch.conf
# Final setup & cleanup
RUN
apt-get
-y
clean
RUN
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
WORKDIR
/var/www/nodejs
USER
apache
CMD
["/bin/bash", "/usr/local/sbin/nodeserver.sh"]
# Final squash & setup
FROM
scratch
COPY
--from=main / /
WORKDIR
/var/www/nodejs
CMD
["/usr/local/sbin/nodeserver.sh"]
USER
apache
CMD
["/bin/bash", "/usr/local/sbin/nodeserver.sh"]
This diff is collapsed.
Click to expand it.
Makefile
+
1
−
1
View file @
c959242d
IMAGE
=
wheks-nodejs22
build
:
DOCKER_BUILDKIT
=
0
docker build
--platform
linux/amd64
--squash
--tag
$(
IMAGE
)
.
docker build
--platform
linux/amd64
--tag
$(
IMAGE
)
.
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