diff --git a/Dockerfile.dev b/Dockerfile.dev deleted file mode 100644 index edbb1d704..000000000 --- a/Dockerfile.dev +++ /dev/null @@ -1,24 +0,0 @@ -FROM python:3.9-alpine as base - -MAINTAINER Antoine Nguyen -ENV VIRTUAL_ENV=/opt/venv -ENV PATH="$VIRTUAL_ENV/bin:$PATH" - -FROM base as build - -RUN apk add --update openssl librrd python3-dev libffi-dev gcc g++ musl-dev libxml2-dev libxslt-dev \ - libressl-dev jpeg-dev rrdtool-dev file make \ - && rm -rf /var/cache/apk/* -RUN python3 -m venv $VIRTUAL_ENV -WORKDIR /tmp -COPY requirements.txt /tmp -COPY test-requirements.txt /tmp -RUN python -m pip install -U pip -RUN pip install -r requirements.txt -r test-requirements.txt - -FROM base as run -COPY --from=build $VIRTUAL_ENV $VIRTUAL_ENV -RUN apk add --no-cache --update librrd libxslt libjpeg libressl git rrdtool \ - && rm -rf /var/cache/apk/* -RUN mkdir /code -WORKDIR /code diff --git a/doc/contributing/getting_started.rst b/doc/contributing/getting_started.rst index f45b65f07..d286a4a0d 100644 --- a/doc/contributing/getting_started.rst +++ b/doc/contributing/getting_started.rst @@ -17,7 +17,7 @@ Then, just run the following command:: $ docker-compose up It will start the docker environment and make a Modoboa instance -available at ``http://localhost:8000``. +available at ``http://localhost:8000`` and the new admin interface at ``http://localhost:8080`` If you don't want to use docker or need a more complex development setup, go to the next section. diff --git a/docker-compose.yml b/docker-compose.yml index 5630bfb11..82747a3e5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,13 +2,13 @@ version: '3' services: web: + container_name: modoboa_api + restart: always build: context: . - dockerfile: Dockerfile.dev - expose: - - "8000" + dockerfile: docker/Dockerfile.dev ports: - - "8000:8000" + - 8000:8000 environment: PYTHONPATH: ".." DB: "SQLITE" @@ -16,3 +16,18 @@ services: command: sh -c "cd test_project && python3 manage.py migrate && python3 manage.py load_initial_data && python3 manage.py runserver 0:8000" volumes: - .:/code + + new_admin: + container_name: modoboa_new_admin + restart: always + build: + context: . + dockerfile: docker/Dockerfile.admin.dev + ports: + - 8080:8080 + command: "" + volumes: + - ./frontend/:/home/node/ + command: "yarn serve" + depends_on: + - web diff --git a/frontend/vue.config.js b/frontend/vue.config.js index 04e0c0436..cd62da792 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -1,16 +1,12 @@ module.exports = { devServer: { proxy: { - '/api': { - target: 'http://localhost:8000/' - } - } + "/api": { + target: "http://localhost:8000/", + }, + }, }, - transpileDependencies: [ - 'vuetify' - ], - publicPath: process.env.NODE_ENV === 'production' - ? '/new-admin/' - : '/', - outputDir: '../modoboa/frontend_dist' -} + transpileDependencies: ["vuetify"], + publicPath: process.env.NODE_ENV === "production" ? "/new-admin/" : "/", + outputDir: "../modoboa/frontend_dist", +};