Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
megahirt committed Dec 2, 2021
2 parents 0fd368c + 617c0cc commit c24a72b
Show file tree
Hide file tree
Showing 28 changed files with 13,877 additions and 11,085 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-and-publish-adhoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish ad-hoc image to Docker Hub

# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
on:
push:
paths:
- '**build-and-publish-adhoc.yml'

jobs:
build-n-publish:
runs-on: ubuntu-latest

env:
IMAGE: sillsdev/web-languageforge:pr-1247-blue

steps:
- uses: actions/checkout@v2

- name: Build and tag app
run: docker build -t ${{ env.IMAGE }}-${GITHUB_SHA} -f docker/app/Dockerfile .

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Publish image
run: |
docker push ${{ env.IMAGE }}-${GITHUB_SHA}
29 changes: 29 additions & 0 deletions .github/workflows/build-and-publish-npm-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and publish an NPM cache image

# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
on:
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-n-publish:
runs-on: ubuntu-latest

env:
IMAGE: sillsdev/web-languageforge:npm-cache

steps:
- uses: actions/checkout@v2

- name: Build and tag cache image
run: docker build -t ${{ env.IMAGE }} -f docker/npm-cache/Dockerfile .

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Publish image
run: |
docker push ${{ env.IMAGE }}
1 change: 1 addition & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ clean-volumes:
.PHONY: clean-powerwash
clean-powerwash: clean-volumes
docker-compose down --rmi all
docker rmi -f lf-npm-cache:npm-cache
17 changes: 9 additions & 8 deletions docker/app/000-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
<Directory "/var/www/html/cache">
Require all denied
</Directory>

# https://httpd.apache.org/docs/2.4/mod/core.html#loglevel
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

<ifModule mod_headers.c>
# https://httpd.apache.org/docs/2.4/mod/core.html#files
<Files "service-worker.js">
# https://httpd.apache.org/docs/current/mod/mod_headers.html
Header Set Service-Worker-allowed "/"
</Files>
</IfModule>

<ifModule mod_headers.c>
# https://httpd.apache.org/docs/2.4/mod/core.html#files
<Files "service-worker.js">
# https://httpd.apache.org/docs/current/mod/mod_headers.html
Header Set Service-Worker-allowed "/"
</Files>
</IfModule>
</VirtualHost>
20 changes: 10 additions & 10 deletions docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ RUN npm config set unsafe-perm true && npm install -g [email protected]
RUN mkdir -p /data
WORKDIR /data

# unsafe-perm true is required to work around an npm bug since we are running as root, have a git+HTTPS repo source and it has a `prepare` script (perfect storm).
# see https://github.com/npm/npm/issues/17346
COPY package.json package-lock.json ./
RUN npm config set unsafe-perm true && npm install --legacy-peer-deps
# copy npm cache directory; as optimization for npm install
COPY --from=sillsdev/web-languageforge:npm-cache /root/.npm /root/.npm

# Copy in files needed for compilation, located in the repo root
COPY typings ./typings/
COPY webpack.config.js webpack-dev.config.js webpack-prd.config.js tsconfig.json tslint.json ./
COPY package.json package-lock.json webpack.config.js webpack-dev.config.js webpack-prd.config.js tsconfig.json tslint.json ./

# unsafe-perm true is required to work around an npm bug since we are running as root, have a git+HTTPS repo source and it has a `prepare` script (perfect storm).
# see https://github.com/npm/npm/issues/17346
RUN npm config set unsafe-perm true && npm install --legacy-peer-deps

# copy in src local files
# Note: *.html files in src/angular-app aren't necessary for webpack compilation, however changes to HTML files will invalidate this layer
COPY src/angular-app ./src/angular-app
COPY src/appManifest ./src/appManifest
COPY src/js ./src/js
COPY src/json ./src/json
COPY src/sass ./src/sass
COPY src/service-worker ./src/service-worker
COPY src/Site/views ./src/Site/views
COPY src/Site/views/languageforge/theme/default/sass/ ./src/Site/views/languageforge/theme/default/sass
COPY src/Site/views/shared/*.scss ./src/Site/views/shared/

FROM ui-builder-base AS production-ui-builder
ENV NPM_BUILD_SUFFIX=prd
Expand Down
4 changes: 4 additions & 0 deletions docker/npm-cache/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM node:14.16.1-alpine3.11
COPY package.json package-lock.json ./
RUN npm config set unsafe-perm true && npm install -g [email protected]
RUN npm config set unsafe-perm true && npm install --legacy-peer-deps
1 change: 1 addition & 0 deletions docker/ssl/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# https://caddyserver.com/docs/caddyfile
{
#debug
#auto_https disable_redirects
}

localhost {
Expand Down
1 change: 0 additions & 1 deletion docker/test-e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ COPY src/appManifest ./src/appManifest
COPY src/js ./src/js
COPY src/json ./src/json
COPY src/sass ./src/sass
COPY src/service-worker ./src/service-worker
COPY src/Site/views ./src/Site/views

# artifacts built to /data/src/dist
Expand Down
1 change: 0 additions & 1 deletion docker/ui-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ COPY src/appManifest ./src/appManifest
COPY src/js ./src/js
COPY src/json ./src/json
COPY src/sass ./src/sass
COPY src/service-worker ./src/service-worker
COPY src/Site/views ./src/Site/views

CMD npm run build:dev:watch
Loading

0 comments on commit c24a72b

Please sign in to comment.