From bb51720e0b45ced00dbf6632a1c75d270212ace2 Mon Sep 17 00:00:00 2001 From: DiptoChakrabarty Date: Mon, 17 Aug 2020 20:29:26 +0530 Subject: [PATCH 1/4] doc for running using docker modified --- docs/installation/docker.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/installation/docker.md b/docs/installation/docker.md index 046fd51b6f..e04d1cbe44 100644 --- a/docs/installation/docker.md +++ b/docs/installation/docker.md @@ -20,6 +20,15 @@ git clone https://github.com/fossasia/open-event-server.git && cd open-event-ser export SERVER_NAME=localhost; ``` +* craete env file using the following command + +```sh + cp .env.example .env +``` + Add SECRET_KEY in the env file to run properly in production mode . To generate a good secret value run python -c 'import secrets;print(secrets.token_hex())' + + + * In the same terminal window, run `docker-compose build` to build open-event-server's docker image. This process can take some time. * After build is done, run `docker-compose up` to start the server. @@ -40,17 +49,10 @@ create database opev; * Then exit the shell by typing `\q` and ENTER. -* Now the database is created, so let's create the tables. Open the application's shell by `docker-compose run web sh`. Then write the following commands. - -```bash -python3 create_db.py -# ^^ write super_admin email and password when asked -python3 manage.py db stamp head -``` +* Now the database is created, so let's create the tables. Open the application's shell by `docker-compose run web sh`. -* Close the application's shell by `exit` command. -* That's it. Go to `localhost` on the web browser and Open Event Orga Server will be live. +* That's it. Go to `localhost:8080` on the web browser and Open Event Orga Server will be live. ### Updating the Docker image @@ -65,7 +67,7 @@ python3 manage.py db stamp head docker-compose run web python3 manage.py db upgrade ``` -* That should be all. Open `localhost` in web browser to view the updated open-event-server. +* That should be all. Open `localhost:8080` in web browser to view the updated open-event-server. From bb7e80795975be01c7a526d756c78c6b4fb878d8 Mon Sep 17 00:00:00 2001 From: DiptoChakrabarty Date: Tue, 18 Aug 2020 02:02:28 +0530 Subject: [PATCH 2/4] modified steps to run server in docker --- docs/installation/docker.md | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/docs/installation/docker.md b/docs/installation/docker.md index e04d1cbe44..0d4e4751b5 100644 --- a/docs/installation/docker.md +++ b/docs/installation/docker.md @@ -13,13 +13,6 @@ git clone https://github.com/fossasia/open-event-server.git && cd open-event-server ``` -* Then set the required `SERVER_NAME` environment variable. `SERVER_NAME` should the same as the domain on which the server is running and it should not include 'http', 'https', -'www' or the trailing slash (/) in the url. Examples - `domain.com`, `sub.domain.com`, `sub.domain.com:5000` etc - -```bash -export SERVER_NAME=localhost; -``` - * craete env file using the following command ```sh @@ -28,30 +21,10 @@ export SERVER_NAME=localhost; Add SECRET_KEY in the env file to run properly in production mode . To generate a good secret value run python -c 'import secrets;print(secrets.token_hex())' - * In the same terminal window, run `docker-compose build` to build open-event-server's docker image. This process can take some time. * After build is done, run `docker-compose up` to start the server. -* If you are doing it for the first time, you will have to create the database (and then tables). -So keeping `docker-compose up` active in one terminal window, open another terminal window **in the same directory**. In there type the following command. - -```bash -docker-compose run postgres psql -h postgres -p 5432 -U open_event_user --password open_event -``` - -* Write 'opev_pass' as password and ENTER. When inside psql shell, write the following command - - -```sql -create database opev; -# CREATE DATABASE -``` - -* Then exit the shell by typing `\q` and ENTER. - -* Now the database is created, so let's create the tables. Open the application's shell by `docker-compose run web sh`. - - * That's it. Go to `localhost:8080` on the web browser and Open Event Orga Server will be live. From ea382e006ff151777bb22455eb0298317c809323 Mon Sep 17 00:00:00 2001 From: DiptoChakrabarty Date: Tue, 18 Aug 2020 10:27:29 +0530 Subject: [PATCH 3/4] update changes to doc --- docs/installation/docker.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/installation/docker.md b/docs/installation/docker.md index 0d4e4751b5..84d5a7378f 100644 --- a/docs/installation/docker.md +++ b/docs/installation/docker.md @@ -13,17 +13,15 @@ git clone https://github.com/fossasia/open-event-server.git && cd open-event-server ``` -* craete env file using the following command +* create env file using the following command ```sh cp .env.example .env ``` - Add SECRET_KEY in the env file to run properly in production mode . To generate a good secret value run python -c 'import secrets;print(secrets.token_hex())' - - + * In the same terminal window, run `docker-compose build` to build open-event-server's docker image. This process can take some time. -* After build is done, run `docker-compose up` to start the server. +* After build is done, run `docker-compose up -d` to start the server. * That's it. Go to `localhost:8080` on the web browser and Open Event Orga Server will be live. From c19f5c6d681af3ff707120ea351b0f018f843dc7 Mon Sep 17 00:00:00 2001 From: DiptoChakrabarty Date: Tue, 18 Aug 2020 18:12:48 +0530 Subject: [PATCH 4/4] env file secret key addition --- docs/installation/docker.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/installation/docker.md b/docs/installation/docker.md index 84d5a7378f..2d9e57c385 100644 --- a/docs/installation/docker.md +++ b/docs/installation/docker.md @@ -18,6 +18,7 @@ git clone https://github.com/fossasia/open-event-server.git && cd open-event-ser ```sh cp .env.example .env ``` +Add SECRET_KEY in the env file to run properly in production mode . To generate a good secret value run python -c 'import secrets;print(secrets.token_hex())' * In the same terminal window, run `docker-compose build` to build open-event-server's docker image. This process can take some time.