Verified Commit 96d219df authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Local .env logic for webpack custom port

parent 75710638
...@@ -86,3 +86,4 @@ front/selenium-debug.log ...@@ -86,3 +86,4 @@ front/selenium-debug.log
docs/_build docs/_build
data/ data/
.env
...@@ -73,6 +73,19 @@ via the following command:: ...@@ -73,6 +73,19 @@ via the following command::
docker-compose -f dev.yml build docker-compose -f dev.yml build
Creating your env file
^^^^^^^^^^^^^^^^^^^^^^
We provide a working .env.dev configuration file that is suitable for
development. However, to enable customization on your machine, you should
also create a .env file that will hold your personal environment
variables (those will not be commited to the project).
Create it like this::
touch .env
Database management Database management
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
......
version: '2' version: '3'
services: services:
front: front:
build: front build: front
env_file: .env.dev env_file:
- .env.dev
- .env
environment: environment:
- "HOST=0.0.0.0" - "HOST=0.0.0.0"
- "WEBPACK_DEVSERVER_PORT=${WEBPACK_DEVSERVER_PORT-8080}"
ports: ports:
- "8080:8080" - "${WEBPACK_DEVSERVER_PORT-8080}:${WEBPACK_DEVSERVER_PORT-8080}"
volumes: volumes:
- './front:/app' - './front:/app'
postgres: postgres:
env_file: .env.dev env_file:
- .env.dev
- .env
image: postgres image: postgres
redis: redis:
env_file: .env.dev env_file:
- .env.dev
- .env
image: redis:3.0 image: redis:3.0
celeryworker: celeryworker:
env_file: .env.dev env_file:
- .env.dev
- .env
build: build:
context: ./api context: ./api
dockerfile: docker/Dockerfile.test dockerfile: docker/Dockerfile.test
...@@ -41,7 +49,9 @@ services: ...@@ -41,7 +49,9 @@ services:
- ./api:/app - ./api:/app
- ./data/music:/music - ./data/music:/music
api: api:
env_file: .env.dev env_file:
- .env.dev
- .env
build: build:
context: ./api context: ./api
dockerfile: docker/Dockerfile.test dockerfile: docker/Dockerfile.test
...@@ -62,7 +72,9 @@ services: ...@@ -62,7 +72,9 @@ services:
- redis - redis
nginx: nginx:
env_file: .env.dev env_file:
- .env.dev
- .env
image: nginx image: nginx
links: links:
- api - api
......
...@@ -23,7 +23,7 @@ module.exports = { ...@@ -23,7 +23,7 @@ module.exports = {
}, },
dev: { dev: {
env: require('./dev.env'), env: require('./dev.env'),
port: 8080, port: parseInt(process.env.WEBPACK_DEVSERVER_PORT),
host: '127.0.0.1', host: '127.0.0.1',
autoOpenBrowser: true, autoOpenBrowser: true,
assetsSubDirectory: 'static', assetsSubDirectory: 'static',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment