Skip to content

Commit c24a72b

Browse files
committed
Merge branch 'staging'
2 parents 0fd368c + 617c0cc commit c24a72b

File tree

28 files changed

+13877
-11085
lines changed

28 files changed

+13877
-11085
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish ad-hoc image to Docker Hub
2+
3+
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
4+
on:
5+
push:
6+
paths:
7+
- '**build-and-publish-adhoc.yml'
8+
9+
jobs:
10+
build-n-publish:
11+
runs-on: ubuntu-latest
12+
13+
env:
14+
IMAGE: sillsdev/web-languageforge:pr-1247-blue
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Build and tag app
20+
run: docker build -t ${{ env.IMAGE }}-${GITHUB_SHA} -f docker/app/Dockerfile .
21+
22+
- name: Log in to Docker Hub
23+
uses: docker/login-action@v1
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
27+
28+
- name: Publish image
29+
run: |
30+
docker push ${{ env.IMAGE }}-${GITHUB_SHA}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build and publish an NPM cache image
2+
3+
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
4+
on:
5+
workflow_dispatch:
6+
7+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
8+
jobs:
9+
build-n-publish:
10+
runs-on: ubuntu-latest
11+
12+
env:
13+
IMAGE: sillsdev/web-languageforge:npm-cache
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Build and tag cache image
19+
run: docker build -t ${{ env.IMAGE }} -f docker/npm-cache/Dockerfile .
20+
21+
- name: Log in to Docker Hub
22+
uses: docker/login-action@v1
23+
with:
24+
username: ${{ secrets.DOCKERHUB_USERNAME }}
25+
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
26+
27+
- name: Publish image
28+
run: |
29+
docker push ${{ env.IMAGE }}

docker/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,4 @@ clean-volumes:
5757
.PHONY: clean-powerwash
5858
clean-powerwash: clean-volumes
5959
docker-compose down --rmi all
60+
docker rmi -f lf-npm-cache:npm-cache

docker/app/000-default.conf

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@
77
<Directory "/var/www/html/cache">
88
Require all denied
99
</Directory>
10-
10+
1111
# https://httpd.apache.org/docs/2.4/mod/core.html#loglevel
1212
#LogLevel info ssl:warn
1313
ErrorLog ${APACHE_LOG_DIR}/error.log
1414
CustomLog ${APACHE_LOG_DIR}/access.log combined
1515

16-
<ifModule mod_headers.c>
17-
# https://httpd.apache.org/docs/2.4/mod/core.html#files
18-
<Files "service-worker.js">
19-
# https://httpd.apache.org/docs/current/mod/mod_headers.html
20-
Header Set Service-Worker-allowed "/"
21-
</Files>
22-
</IfModule>
16+
17+
<ifModule mod_headers.c>
18+
# https://httpd.apache.org/docs/2.4/mod/core.html#files
19+
<Files "service-worker.js">
20+
# https://httpd.apache.org/docs/current/mod/mod_headers.html
21+
Header Set Service-Worker-allowed "/"
22+
</Files>
23+
</IfModule>
2324
</VirtualHost>

docker/app/Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ RUN npm config set unsafe-perm true && npm install -g [email protected]
1010
RUN mkdir -p /data
1111
WORKDIR /data
1212

13-
# 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).
14-
# see https://github.com/npm/npm/issues/17346
15-
COPY package.json package-lock.json ./
16-
RUN npm config set unsafe-perm true && npm install --legacy-peer-deps
13+
# copy npm cache directory; as optimization for npm install
14+
COPY --from=sillsdev/web-languageforge:npm-cache /root/.npm /root/.npm
1715

1816
# Copy in files needed for compilation, located in the repo root
1917
COPY typings ./typings/
20-
COPY webpack.config.js webpack-dev.config.js webpack-prd.config.js tsconfig.json tslint.json ./
18+
COPY package.json package-lock.json webpack.config.js webpack-dev.config.js webpack-prd.config.js tsconfig.json tslint.json ./
19+
20+
# 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).
21+
# see https://github.com/npm/npm/issues/17346
22+
RUN npm config set unsafe-perm true && npm install --legacy-peer-deps
2123

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

3131
FROM ui-builder-base AS production-ui-builder
3232
ENV NPM_BUILD_SUFFIX=prd

docker/npm-cache/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM node:14.16.1-alpine3.11
2+
COPY package.json package-lock.json ./
3+
RUN npm config set unsafe-perm true && npm install -g [email protected]
4+
RUN npm config set unsafe-perm true && npm install --legacy-peer-deps

docker/ssl/Caddyfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# https://caddyserver.com/docs/caddyfile
22
{
33
#debug
4+
#auto_https disable_redirects
45
}
56

67
localhost {

docker/test-e2e/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ COPY src/appManifest ./src/appManifest
2222
COPY src/js ./src/js
2323
COPY src/json ./src/json
2424
COPY src/sass ./src/sass
25-
COPY src/service-worker ./src/service-worker
2625
COPY src/Site/views ./src/Site/views
2726

2827
# artifacts built to /data/src/dist

docker/ui-builder/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ COPY src/appManifest ./src/appManifest
2121
COPY src/js ./src/js
2222
COPY src/json ./src/json
2323
COPY src/sass ./src/sass
24-
COPY src/service-worker ./src/service-worker
2524
COPY src/Site/views ./src/Site/views
2625

2726
CMD npm run build:dev:watch

0 commit comments

Comments
 (0)