Skip to content
Snippets Groups Projects
Verified Commit 7a854f52 authored by David Beniamine's avatar David Beniamine
Browse files

Serve static path www by npm dev server

parent 545fd75c
Branches
No related tags found
1 merge request!4Add a dev server
# docker-compose components. Append ':devserver.yml' to also run the dev server (default is prod only) # docker-compose components replace by devserver.yml to run the dev server (default is prod) or append ':devserver.yml' to run both
COMPOSE_FILE=docker-compose.yml COMPOSE_FILE=docker-compose.yml
# prod server host port # prod server host port
PORT=8080 PORT=8080
......
...@@ -7,7 +7,9 @@ services: ...@@ -7,7 +7,9 @@ services:
restart: $DEV_RESTART restart: $DEV_RESTART
ports: ports:
- $DEV_PORT:9000 - $DEV_PORT:9000
volumes:
- ./:/opt
environment: environment:
- CORS_ALLOWED_HOSTS
- WEBPACK_MODE=development - WEBPACK_MODE=development
- HTTP_FOLDER
volumes:
- ./:/opt
...@@ -12,10 +12,17 @@ module.exports = { ...@@ -12,10 +12,17 @@ module.exports = {
devServer: { devServer: {
hot: true, hot: true,
watchFiles: ['src/**/*'], watchFiles: ['src/**/*'],
static: { static: [
{
directory: path.join(__dirname, 'public'), directory: path.join(__dirname, 'public'),
watch: true watch: true
}, },
{
directory: path.join(__dirname, process.env.HTTP_FOLDER ? process.env.HTTP_FOLDER : 'www'),
watch: false,
publicPath: '/data'
},
],
port: 9000 port: 9000
}, },
plugins: [ plugins: [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment