This repository has been archived by the owner on Jun 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 172
take Kumascript Dockerfile from kuma #1249
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM node:10.16.3@sha256:e0f7dabe991810057aee6ba7a7d4136fe7fc70e99235d79e6c7ae0177656a5c8 | ||
|
||
RUN set -ex && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
gettext \ | ||
mime-support \ | ||
build-essential \ | ||
python2.7 \ | ||
default-jre \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# remove the node user from the base package and add a non-privileged user | ||
RUN userdel --force --remove node && \ | ||
adduser --uid 1000 --disabled-password --gecos '' --no-create-home kumascript | ||
|
||
ARG REVISION_HASH | ||
# make the git commit hash permanently available within this image. | ||
ENV REVISION_HASH $REVISION_HASH | ||
|
||
WORKDIR / | ||
|
||
COPY kumascript/package.json kumascript/npm-shrinkwrap.json / | ||
RUN npm config set python /usr/bin/python2.7 && \ | ||
# install the Node.js dependencies, | ||
# with versions specified in npm-shrinkwrap.json | ||
npm ci && \ | ||
# update any top-level npm packages listed in package.json, | ||
# such as mdn-browser-compat-data, | ||
# as allowed by each package's given "semver". | ||
npm update | ||
ENV NODE_PATH=/node_modules | ||
RUN chown -R kumascript:kumascript $NODE_PATH | ||
|
||
# install the locale files | ||
WORKDIR /locale | ||
COPY --chown=kumascript:kumascript locale ./ | ||
|
||
WORKDIR /app | ||
COPY --chown=kumascript:kumascript kumascript ./ | ||
|
||
USER kumascript | ||
|
||
CMD ["node", "run.js"] | ||
|
||
EXPOSE 9080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
kumascript | ||
---------- | ||
|
||
The kumascript Docker image contains the kumascript rendering engine and | ||
support files. | ||
|
||
The image must be created from the kuma repo since it depends upon that | ||
repo's ``locale`` sub-module. From the kuma repo's root directory, use | ||
``make build-kumascript`` for an image tagged with the current commit-hash, | ||
``make build-kumascript KS_VERSION=latest`` for one tagged with ``latest``, | ||
or ``make build-kumascript-with-all-tags`` for an image tagged with both. | ||
|
||
The image tagged ``latest`` is used by default for development, while an | ||
image tagged with a commit-hash can be used for deployment. The official | ||
images are created from the master branch in Jenkins__ and published to | ||
DockerHub__. | ||
|
||
.. __: https://ci.us-west-2.mdn.mozit.cloud/blue/organizations/jenkins/kumascript/branches/ | ||
.. __: https://hub.docker.com/r/mdnwebdocs/kumascript/ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm ci
is an alias tonpm clean‑install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ExE-Boss It's my understanding that
npm ci
is the proper command. In fact, I don't see anynpm
documentation on anpm clean-install
command, and I think theci
referencescontinuous integration
rather thanclean install
. In any case, I'm going to keep this as it is, since changing it would be outside the scope of this PR anyway.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is as of npm/cli#57.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! Good to know, thanks @ExE-Boss, but I'll leave that for another PR.