Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: running using docker modified #7216

Merged
merged 5 commits into from
Sep 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 8 additions & 34 deletions docs/installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed


* 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
Expand All @@ -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.



Expand Down