Skip to content

Commit 30f02e3

Browse files
committed
Use local resources, start using npm
Adds bundled local assets and stops using toolforge to serve assets
1 parent cf1157a commit 30f02e3

12 files changed

+2137
-952
lines changed

.dockerignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
vendor
2-
public_html/php
2+
public_html/php
3+
node_modules

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
vendor
22
public_html/php
3-
classes
3+
classes
4+
node_modules/
5+
dist/

Dockerfile

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1+
FROM node:12 as npm
2+
3+
WORKDIR /installing
4+
COPY ./ /installing
5+
RUN npm ci --only=production
6+
17
FROM composer@sha256:d374b2e1f715621e9d9929575d6b35b11cf4a6dc237d4a08f2e6d1611f534675 as composer
28
# composer is pinned at a PHP 7 version
39

410
WORKDIR /installing
511
COPY ./ /installing
6-
RUN composer install --no-dev --no-progress && rm -rf vendor/wbstack/magnustools
712

13+
## 1. composer install
14+
## 2. move magnus tools resources to a temp fold to select from (some are selected at the very end)
15+
## 3. finally remove magnustools because it contains so much stuff
16+
RUN composer install --no-dev --no-progress \
17+
&& mv vendor/wbstack/magnustools /installing/magnustools \
18+
&& rm -rf vendor/wbstack/magnustools
819

920
FROM php:7.2-apache
1021

@@ -27,5 +38,9 @@ COPY --from=composer /installing /var/www/html/quickstatements
2738
COPY --from=composer /installing/classes /var/www/html/magnustools/classes
2839
COPY --from=composer /installing/public_html/php /var/www/html/magnustools/public_html/php
2940

41+
## TODO make some kind of sane magnus tools js lib to be included in the bundle
42+
COPY --from=composer /installing/magnustools/public_html/resources /var/www/html/quickstatements/public_html/magnustools/resources
43+
COPY --from=npm /installing/node_modules /var/www/html/quickstatements/public_html/resources
44+
3045
ENTRYPOINT ["/bin/bash"]
3146
CMD ["/entrypoint.sh"]

README

+21
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,24 @@ Using addwiki:
22
https://github.com/addwiki/mediawiki-api
33

44
Copy public_html/config.json.template to config.json and modify for your needs
5+
6+
## NPM Dependencies
7+
8+
Currently the external dependencies are managed by npm, they are installed during the building of the Dockerfile by running the following command
9+
10+
```
11+
npm ci --only=production
12+
```
13+
14+
and then moving the installed libraries to the public_html/ folder.
15+
16+
## TODO
17+
### Add some kind of offline version of https://bitbucket.org/magnusmanske/tooltranslate.git
18+
19+
This could potentially be some kind of homebrew thing that looks at the toolinfo.json and pulls the all the translations when the Dockerfile builds and puts these in the `public_html/` folder
20+
21+
```
22+
https://tools-static.wmflabs.org/tooltranslate/data/quickstatements/toolinfo.json
23+
```
24+
25+
This would also require a rewrite of https://tools-static.wmflabs.org/tooltranslate/tt.js

composer.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)