Skip to content

Commit

Permalink
Merge pull request #315 from seanmorley15/self-hosting-easier
Browse files Browse the repository at this point in the history
Make comments clearer for self hosting
  • Loading branch information
seanmorley15 authored Sep 15, 2024
2 parents 3c43f3c + 3c353fe commit 6defb19
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions backend/server/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,5 @@
},
}

# https://github.com/dr5hn/countries-states-cities-database/tags
COUNTRY_REGION_JSON_VERSION = 'v2.4'
15 changes: 9 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
version: "3.9"

services:
web:
#build: ./frontend/
image: ghcr.io/seanmorley15/adventurelog-frontend:latest
container_name: adventurelog-frontend
restart: unless-stopped
environment:
- PUBLIC_SERVER_URL=http://server:8000 # MOST DOCKER USERS WILL NEVER NEED TO CHANGE THIS, EVEN IF YOU CHANGE THE PORTS
- ORIGIN=http://localhost:8080
Expand All @@ -17,6 +16,7 @@ services:
db:
image: postgis/postgis:15-3.3
container_name: adventurelog-db
restart: unless-stopped
environment:
POSTGRES_DB: database
POSTGRES_USER: adventure
Expand All @@ -28,19 +28,21 @@ services:
#build: ./backend/
image: ghcr.io/seanmorley15/adventurelog-backend:latest
container_name: adventurelog-backend
restart: unless-stopped
environment:
- PGHOST=db
- PGDATABASE=database
- PGUSER=adventure
- PGPASSWORD=changeme123
- PGPASSWORD=changeme123 # This should be the same as the POSTGRES_PASSWORD in the db service
- SECRET_KEY=changeme123
- DJANGO_ADMIN_USERNAME=admin
- DJANGO_ADMIN_PASSWORD=admin
- [email protected]
- PUBLIC_URL='http://localhost:81'
- CSRF_TRUSTED_ORIGINS=https://api.adventurelog.app,https://adventurelog.app
- PUBLIC_URL='http://localhost:81' # NOTE: THIS IS THE PUBLIC URL TO THE **NGINX** SERVER USED FOR MEDIA FILES!
- CSRF_TRUSTED_ORIGINS=https://api.adventurelog.app,https://adventurelog.app # This is a comma separated list of trusted origins for CSRF, this should include where your frontend is hosted.
- DEBUG=False
- FRONTEND_URL='http://localhost:8080'
- FRONTEND_URL='http://localhost:8080' # This is the URL of the frontend server
#- DISABLE_REGISTRATION=True
ports:
- "8000:8000"
depends_on:
Expand All @@ -51,6 +53,7 @@ services:
nginx:
image: nginx:latest
container_name: adventurelog-nginx
restart: unless-stopped
ports:
- "81:80"
volumes:
Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/Usage/updating.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ docker compose up -d

## Updating the Region Data

Region data in AdventureLog is stored in a seeding file. This file can change and there is an easy command to resync the region data without needing any database changes. This can be run by acessing the contianers terminal as follows.
Region and Country data in AdventureLog is provided by an open source project: [dr5hn/countries-states-cities-database](https://github.com/dr5hn/countries-states-cities-database). If you would like to update the region data in your AdventureLog instance, you can do so by running the following command. This will make sure your database is up to date with the latest region data for your version of AdventureLog. For security reasons, the region data is not automatically updated to the latest and is release version is controlled in the `settings.py` file.

```bash
docker exec -it <container> bash
Expand All @@ -24,5 +24,5 @@ docker exec -it <container> bash
Once you are in the container run the following command to resync the region data.

```bash
python manage.py worldtravel-seed --force
python manage.py download-countries
```

0 comments on commit 6defb19

Please sign in to comment.