use external database #13

Merged
fedy95 merged 1 commits from use-external-database into master 4 years ago
  1. 1
      .gitignore
  2. 1
      README.md
  3. 12
      docker-compose.yml
  4. 1
      env/.gitignore
  5. 3
      env/netbox.env-dist
  6. 3
      env/postgres.env-dist

1
.gitignore

@ -1,2 +1 @@
/etc/postgres
/venv /venv

1
README.md

@ -8,5 +8,4 @@
### services ### services
- [netbox](https://hub.docker.com/r/netboxcommunity/netbox) - [netbox](https://hub.docker.com/r/netboxcommunity/netbox)
- [nginx](https://hub.docker.com/_/nginx) - [nginx](https://hub.docker.com/_/nginx)
- [postgres](https://hub.docker.com/_/postgres)
- [redis](https://hub.docker.com/_/redis) - [redis](https://hub.docker.com/_/redis)

12
docker-compose.yml

@ -18,7 +18,6 @@ services:
hostname: netbox_instance hostname: netbox_instance
depends_on: depends_on:
- postgres
- redis - redis
- redis-cache - redis-cache
- netbox-worker - netbox-worker
@ -60,17 +59,6 @@ services:
- netbox-static-files:/opt/netbox/netbox/static:ro - netbox-static-files:/opt/netbox/netbox/static:ro
command: nginx -c /etc/netbox-nginx/nginx.conf command: nginx -c /etc/netbox-nginx/nginx.conf
postgres:
image: postgres:13.1-alpine
container_name: netbox_postgres
hostname: netbox_postgres
ports:
- "5439:5432"
env_file: env/postgres.env
volumes:
- ./etc/postgres/var/lib/postgresql/data:/var/lib/postgresql/data
redis: redis:
image: redis:6.0.9-alpine image: redis:6.0.9-alpine
container_name: netbox_redis container_name: netbox_redis

1
env/.gitignore

@ -1,6 +1,5 @@
* *
!.gitignore !.gitignore
!netbox.env-dist !netbox.env-dist
!postgres.env-dist
!redis.env-dist !redis.env-dist
!redis-cache.env-dist !redis-cache.env-dist

3
env/netbox.env-dist

@ -8,7 +8,8 @@ SKIP_STARTUP_SCRIPTS=false
RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases
SECRET_KEY= SECRET_KEY=
DB_HOST=postgres
DB_HOST=192.168.1.152
DB_PORT=5432
DB_NAME=netbox DB_NAME=netbox
DB_USER=netbox DB_USER=netbox
DB_PASSWORD= DB_PASSWORD=

3
env/postgres.env-dist

@ -1,3 +0,0 @@
POSTGRES_DB=netbox
POSTGRES_USER=netbox
POSTGRES_PASSWORD=