-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #449 from TAMULib/staging
September Components Sprint
- Loading branch information
Showing
33 changed files
with
246 additions
and
218 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,69 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
### Git ### | ||
!.gitkeep | ||
|
||
# compiled output | ||
/dist | ||
/tmp | ||
/out-tsc | ||
# Only exists if Bazel was run | ||
/bazel-out | ||
|
||
# dependencies | ||
node_modules | ||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
# profiling files | ||
chrome-profiler-events*.json | ||
speed-measure-plugin*.json | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
|
||
# misc | ||
/.sass-cache | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
npm-debug.log | ||
yarn-error.log | ||
testem.log | ||
/typings | ||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
|
||
/.nb-gradle/ | ||
|
||
# System Files | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
dump.rdb | ||
|
||
|
||
### OS Specific ### | ||
.DS_Store | ||
Thumbs.db | ||
.tmp/ | ||
|
||
tmp/ | ||
|
||
|
||
### Node / NPM ### | ||
coverage/ | ||
development/ | ||
docs/ | ||
static/ | ||
.lighthouseci/ | ||
.vscode/ | ||
logs/ | ||
node_modules/ | ||
|
||
.npmrc | ||
|
||
npm-debug.log | ||
package-lock.json | ||
yarn.lock | ||
|
||
|
||
### Project Specific ### | ||
src/config.json | ||
src/config-template.json | ||
src/assets/icons/* | ||
!src/assets/icons/tl | ||
!src/assets/icons/bootstrap | ||
src/assets/tinymce/ | ||
!src/assets/icons/custom/weaver-w.svg | ||
!src/assets/icons/feather/chevron-right.svg | ||
|
||
.wvr-ud/static-assets/styles.css | ||
.verdaccio | ||
|
||
docs/ | ||
static/ | ||
development/ | ||
.lighthouseci/ |
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 |
---|---|---|
@@ -1,38 +1,73 @@ | ||
FROM node:16-slim as npm | ||
# Settings. | ||
ARG USER_ID=3001 | ||
ARG USER_NAME=components | ||
ARG SOURCE_DIR=/$USER_NAME/source | ||
ARG NPM_REGISTRY=upstream | ||
ARG NODE_ENV=development | ||
|
||
COPY package.json ./ | ||
# Node stage. | ||
FROM node:lts-slim as build | ||
ARG USER_ID | ||
ARG USER_NAME | ||
ARG SOURCE_DIR | ||
ARG NPM_REGISTRY | ||
ARG NODE_ENV | ||
|
||
WORKDIR /app | ||
COPY . . | ||
ENV NODE_ENV=$NODE_ENV | ||
|
||
RUN npm install | ||
RUN npm run build | ||
# Create the user and group (use a high ID to attempt to avoid conflicts). | ||
RUN groupadd --non-unique -g $USER_ID $USER_NAME && \ | ||
useradd --non-unique -d /$USER_NAME -m -u $USER_ID -g $USER_ID $USER_NAME | ||
|
||
FROM httpd:2.4-alpine | ||
# Update the system and install dependencies (iproute2 is needed for "ip"). | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt install iproute2 -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ARG MAJOR_VERSION=0x | ||
ARG MAJOR_MINOR_VERSION=0.0 | ||
# Copy in files from outside of docker. | ||
COPY . $SOURCE_DIR | ||
|
||
# Ensure required file permissions. | ||
RUN chown -R $USER_ID:$USER_ID $SOURCE_DIR | ||
|
||
# Set deployment directory. | ||
WORKDIR $SOURCE_DIR | ||
|
||
COPY --from=npm /app/dist/bundle/ /usr/local/apache2/htdocs/tl-components/bundle | ||
# Login as user. | ||
USER $USER_NAME | ||
|
||
RUN ln -s /usr/local/apache2/htdocs/tl-components/bundle /usr/local/apache2/htdocs/tl-components/latest | ||
RUN ln -s /usr/local/apache2/htdocs/tl-components/bundle /usr/local/apache2/htdocs/tl-components/${MAJOR_VERSION}x | ||
RUN ln -s /usr/local/apache2/htdocs/tl-components/bundle /usr/local/apache2/htdocs/tl-components/${MAJOR_MINOR_VERSION} | ||
# Perform actions. | ||
RUN echo $NPM_REGISTRY && \ | ||
bash build/docker-npmrc.sh $NPM_REGISTRY && \ | ||
npm install && \ | ||
npm run build | ||
|
||
# Apache stage. | ||
FROM httpd:2.4-alpine | ||
ARG SOURCE_DIR | ||
ARG MAJOR_VERSION=0x | ||
ARG MAJOR_MINOR_VERSION=0.0 | ||
|
||
COPY --from=npm /app/src/config-template.json tmp/config-template.json | ||
COPY docker-entrypoint /usr/local/bin/ | ||
COPY --from=build $SOURCE_DIR/dist/bundle/ /usr/local/apache2/htdocs/tl-components/bundle | ||
COPY --from=build $SOURCE_DIR/src/config-template.json tmp/config-template.json | ||
|
||
RUN chmod +x /usr/local/bin/docker-entrypoint | ||
RUN ln -s /usr/local/apache2/htdocs/tl-components/bundle /usr/local/apache2/htdocs/tl-components/latest && \ | ||
ln -s /usr/local/apache2/htdocs/tl-components/bundle /usr/local/apache2/htdocs/tl-components/${MAJOR_VERSION}x && \ | ||
ln -s /usr/local/apache2/htdocs/tl-components/bundle /usr/local/apache2/htdocs/tl-components/${MAJOR_MINOR_VERSION} | ||
|
||
ENTRYPOINT ["docker-entrypoint"] | ||
COPY build/docker-entrypoint.sh /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh | ||
|
||
RUN apk update; | ||
RUN apk upgrade; | ||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
|
||
RUN echo "" >> /usr/local/apache2/conf/httpd.conf | ||
RUN echo "###SPECIFIC CUSTOMIZATIONS###" >> /usr/local/apache2/conf/httpd.conf | ||
RUN echo "" >> /usr/local/apache2/conf/httpd.conf | ||
RUN apk update && \ | ||
apk upgrade | ||
|
||
RUN printf '<Directory /usr/local/apache2/htdocs> \nOrder Allow,Deny \nAllow from all \nAllowOverride all \nHeader set Access-Control-Allow-Origin "*" \n</Directory>' >> /usr/local/apache2/conf/httpd.conf | ||
RUN echo "" >> /usr/local/apache2/conf/httpd.conf && \ | ||
echo "###SPECIFIC CUSTOMIZATIONS###" >> /usr/local/apache2/conf/httpd.conf && \ | ||
echo "" >> /usr/local/apache2/conf/httpd.conf && \ | ||
printf '<Directory /usr/local/apache2/htdocs> \nOrder Allow,Deny \nAllow from all \nAllowOverride all \nHeader set Access-Control-Allow-Origin "*" \n</Directory>' >> /usr/local/apache2/conf/httpd.conf | ||
|
||
CMD ["httpd", "-D", "FOREGROUND"] |
File renamed without changes.
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,17 @@ | ||
#!/bin/bash | ||
# Requires ip and awk, but only for docker-linux. | ||
|
||
main() { | ||
if [[ $1 == "docker-linux" ]] ; then | ||
to_npmrc $(ip route | awk '/^default via/ { print $3 }') | ||
elif [[ $1 == "docker-windows" || $1 == "docker-mac" ]] ; then | ||
to_npmrc host.docker.internal | ||
fi | ||
} | ||
|
||
to_npmrc() { | ||
echo "Setting NPM registry to '$1'." | ||
echo "registry=http://$1:4873" >> .npmrc | ||
} | ||
|
||
main "$@" |
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
Oops, something went wrong.