Make the new admin available with docker compose

This commit is contained in:
Gaëtan L
2023-02-16 15:31:42 +01:00
parent a08bf13171
commit 3145f10bd4
4 changed files with 28 additions and 41 deletions
-24
View File
@@ -1,24 +0,0 @@
FROM python:3.9-alpine as base
MAINTAINER Antoine Nguyen <tonio@ngyn.org>
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
+1 -1
View File
@@ -17,7 +17,7 @@ Then, just run the following command::
$ docker-compose up $ docker-compose up
It will start the docker environment and make a Modoboa instance 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 If you don't want to use docker or need a more complex development
setup, go to the next section. setup, go to the next section.
+19 -4
View File
@@ -2,13 +2,13 @@ version: '3'
services: services:
web: web:
container_name: modoboa_api
restart: always
build: build:
context: . context: .
dockerfile: Dockerfile.dev dockerfile: docker/Dockerfile.dev
expose:
- "8000"
ports: ports:
- "8000:8000" - 8000:8000
environment: environment:
PYTHONPATH: ".." PYTHONPATH: ".."
DB: "SQLITE" 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" command: sh -c "cd test_project && python3 manage.py migrate && python3 manage.py load_initial_data && python3 manage.py runserver 0:8000"
volumes: volumes:
- .:/code - .:/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
+8 -12
View File
@@ -1,16 +1,12 @@
module.exports = { module.exports = {
devServer: { devServer: {
proxy: { proxy: {
'/api': { "/api": {
target: 'http://localhost:8000/' target: "http://localhost:8000/",
} },
} },
}, },
transpileDependencies: [ transpileDependencies: ["vuetify"],
'vuetify' publicPath: process.env.NODE_ENV === "production" ? "/new-admin/" : "/",
], outputDir: "../modoboa/frontend_dist",
publicPath: process.env.NODE_ENV === 'production' };
? '/new-admin/'
: '/',
outputDir: '../modoboa/frontend_dist'
}