diff --git a/back/back/.env.example b/.ci_env similarity index 100% rename from back/back/.env.example rename to .ci_env diff --git a/.example_env b/.example_env new file mode 100644 index 000000000..a10fd64e5 --- /dev/null +++ b/.example_env @@ -0,0 +1,6 @@ +DEBUG=True +SECRET_KEY=somethingsupersecret +DEBUG_LOGGING=True +BASE_URL=http://0.0.0.0:8000 +DATABASE_URL=postgres://postgres:postgres@db:5432/postgres +DEFAULT_FROM_EMAIL=hello@chiefonboarding.com diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c2308599..4b5362daf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,8 +38,8 @@ jobs: pipenv install --dev --system - name: Run migrations run: | + mv .ci_env back/back/.env cd back - mv back/.env.example back/.env python manage.py migrate - name: Test with pytest run: | diff --git a/docker-compose.yml b/docker-compose.yml index 2f84b85af..f7a1fd989 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,12 +22,8 @@ services: context: ./back/ ports: - "127.0.0.1:8000:8000" - environment: - - DEBUG=True - - SECRET_KEY=somethingsupersecret - - BASE_URL=http://0.0.0.0:3000 - - DATABASE_URL=postgres://postgres:postgres@db:5432/postgres - - DEFAULT_FROM_EMAIL=hello@chiefonboarding.com + env_file: + - .env volumes: - ./back:/app depends_on: diff --git a/docs/development.md b/docs/development.md index 7e7a45858..4a778afb3 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,6 +1,14 @@ # Development -If you want to contribute or just play around with the source code, the first step would be to download the source code. Then run this to get it all up and running: +If you want to contribute or just play around with the source code, the first step would be to download the source code. + +Then move the example environment file to the real one: + +``` +cp .example_env .env +``` + +Then run this to get it all up and running: ```bash docker-compose up