Browse Source

Automate bundle creation

pull/80/head
Clemens Wolff 5 years ago
parent
commit
821ec0ec87
4 changed files with 27 additions and 3 deletions
  1. 13
      Dockerfile
  2. 13
      README.md
  3. 1
      app/server/package.json
  4. 3
      app/server/webpack.config.js

13
Dockerfile

@ -1,10 +1,21 @@
ARG PYTHON_VERSION="3.6"
FROM python:${PYTHON_VERSION}
ARG NODE_VERSION="8.x"
RUN curl -sL "https://deb.nodesource.com/setup_${NODE_VERSION}" | bash - \
&& apt-get install nodejs \
&& rm -rf /var/lib/apt/lists/*
COPY app/server/package*.json /doccano/app/server/
RUN cd /doccano/app/server && npm ci
COPY requirements.txt /
RUN pip install --no-cache-dir -r /requirements.txt
COPY app/server/static /doccano/app/server/static/
COPY app/server/webpack.config.js /doccano/app/server/
RUN cd /doccano/app/server && DEBUG=False npm run build
COPY . /doccano
WORKDIR /doccano

13
README.md

@ -66,12 +66,23 @@ docker build -t doccano:1 .
**Option2: Setup Python environment**
First we need to install the dependencies. Run the following commands:
```bash
pip install -r requirements.txt
cd app
```
First we need to make migration. Run the following command:
Next we need to compile the frontend. Run the following commands:
```bash
cd server
npm install
npm run build
cd ..
```
Next we need to make migration. Run the following command:
```bash
python manage.py migrate

1
app/server/package.json

@ -3,6 +3,7 @@
"version": "1.0.0",
"main": "index.js",
"scripts": {
"build": "webpack",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",

3
app/server/webpack.config.js

@ -1,7 +1,8 @@
const process = require('process');
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
mode: 'development',
mode: process.env.DEBUG === 'False' ? 'production' : 'development',
entry: {
'sequence_labeling': './static/js/sequence_labeling.js',
'document_classification': './static/js/document_classification.js',

Loading…
Cancel
Save