diff --git a/docs/installation/docker.md b/docs/installation/docker.md index 046fd51b6f..2d9e57c385 100644 --- a/docs/installation/docker.md +++ b/docs/installation/docker.md @@ -13,44 +13,18 @@ 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 +* create env file using the following command -```bash -export SERVER_NAME=localhost; +```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. - -* 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`. Then write the following commands. - -```bash -python3 create_db.py -# ^^ write super_admin email and password when asked -python3 manage.py db stamp head -``` - -* Close the application's shell by `exit` command. +* After build is done, run `docker-compose up -d` to start the server. -* 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 +39,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.