Skip to content

Commit d2c53fe

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

11 files changed

+2133
-949
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

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
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+
## TODO add this somehow
14+
#RUN git clone https://bitbucket.org/magnusmanske/tooltranslate.git
15+
16+
## 1. composer install
17+
## 2. move magnus tools resources to a temp fold to select from (some are selected at the very end)
18+
## 3. finally remove magnustools because it contains so much stuff
19+
RUN composer install --no-dev --no-progress \
20+
&& mv vendor/wbstack/magnustools/public_html/resources /installing/magnustools/ \
21+
&& rm -rf vendor/wbstack/magnustools
822

923
FROM php:7.2-apache
1024

@@ -27,5 +41,14 @@ COPY --from=composer /installing /var/www/html/quickstatements
2741
COPY --from=composer /installing/classes /var/www/html/magnustools/classes
2842
COPY --from=composer /installing/public_html/php /var/www/html/magnustools/public_html/php
2943

44+
## TODO ToolTranslate
45+
#COPY --from=composer /installing/tooltranslate/public_html/tt.js /var/www/html/quickstatements/public_html/tooltranslate/
46+
47+
## TODO make some kind of sane magnus tools js lib to be included in the bundle
48+
COPY --from=composer /installing/magnustools/html/wikimedia.css /var/www/html/quickstatements/public_html/magnustools/
49+
COPY --from=composer /installing/magnustools/js/wikidata.js /var/www/html/quickstatements/public_html/magnustools/
50+
COPY --from=composer /installing/magnustools/vue/shared.js /var/www/html/quickstatements/public_html/magnustools/
51+
COPY --from=npm /installing/node_modules /var/www/html/quickstatements/public_html/resources
52+
3053
ENTRYPOINT ["/bin/bash"]
3154
CMD ["/entrypoint.sh"]

README

+12
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,15 @@ 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+

0 commit comments

Comments
 (0)