Issue deploying docker #936
Replies: 2 comments
-
Howdy @huntson, I am working on this myself. One thing to note is that Portainer stores all environment variables in a file called Once I get a solid setup going, I'll put instructions here, and maybe in the wiki/readme. |
Beta Was this translation helpful? Give feedback.
-
I was trying to do the same thing running netbox with portainer on my alpine vm. The instructions are for running netbox docker using the docker-compose.yml from the command line with their files from the github project. The project contains an env folder that has multple env files for each container it is going to start (netbox.env, postgres.env, redis.env, redis-cache.env). so I had to figure out what what needed to be moved around because the environment variables are in a separate folder, they used merge keys, and expect you to use the docker-compose.override.yml to add your port mapping and other change it seems. Very helpful information on docker/yaml/portainer to figure what the compose file was doing:
docker-compose in web editor: version: '3.4'
x-merge-keys: &shared_settings
restart: unless-stopped
healthcheck:
start_period: 60s
timeout: 3s
interval: 60s
test: "curl -f http://localhost:8080/api/ || exit 1"
image: docker.io/netboxcommunity/netbox:${VERSION-v3.4-2.5.1}
depends_on:
- postgres
- redis
- redis-cache
env_file:
#- env/redis.env # For using Portainer comment out
- stack.env # For using Portainer uncomment this line
user: 'unit:root'
volumes:
#- ./configuration:/etc/netbox/config:z,ro
#- ./reports:/etc/netbox/reports:z,ro
#- ./scripts:/etc/netbox/scripts:z,ro
- netbox-media-files:/opt/netbox/netbox/media:z
# I switch to named volume and removed readonly. it normally would map to the folders seen in the root of the github project here.
- netbox_data:/etc/netbox:z
services:
netbox:
<<: *shared_settings
ports:
- 8000:8080
netbox-worker:
<<: *shared_settings
depends_on:
netbox:
condition: service_healthy
command:
- /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py
- rqworker
healthcheck:
start_period: 20s
timeout: 3s
interval: 15s
test: "ps -aux | grep -v grep | grep -q rqworker || exit 1"
netbox-housekeeping:
<<: *shared_settings
depends_on:
netbox:
condition: service_healthy
command:
- /opt/netbox/housekeeping.sh
healthcheck:
start_period: 20s
timeout: 3s
interval: 15s
test: "ps -aux | grep -v grep | grep -q housekeeping || exit 1"
# postgres
postgres:
restart: unless-stopped
image: docker.io/postgres:15-alpine
env_file:
#- env/redis.env # For using Portainer comment out
- stack.env # For using Portainer uncomment this line
volumes:
- netbox-postgres-data:/var/lib/postgresql/data
# redis
redis:
restart: unless-stopped
image: docker.io/redis:7-alpine
command:
- sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
env_file:
#- env/redis.env # For using Portainer comment out
- stack.env # For using Portainer uncomment this line
volumes:
- netbox-redis-data:/data
redis-cache:
restart: unless-stopped
image: redis:7-alpine
command:
- sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env
- redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
# env_file: # For using Portainer comment out
#- env/redis.env # For using Portainer comment out
environment: # For using Portainer uncomment this line
- REDIS_PASSWORD=${REDIS_CACHE_PASSWORD} # For using Portainer uncomment this line
volumes:
- netbox-redis-cache-data:/data
volumes:
netbox-media-files:
driver: local
netbox-postgres-data:
driver: local
netbox-redis-data:
driver: local
netbox-redis-cache-data:
driver: local
netbox_data:
driver: local . |
Beta Was this translation helpful? Give feedback.
-
Current Behavior
I cannot get past a certain point when deploying via Portainer. When I copy and paste all the yaml file into a Stacks config, I get the following error: 'failed to deploy a stack: open /data/compose/34/env/netbox.env: no such file ro directory'
Each time I attempt to deploy the number goes up: 35, 36, etc
Expected Behavior
I'd expect the Docker to deploy.
Docker Compose Version
20.10.14
Docker Version
The git Revision
?????
The git Status
Startup Command
n/a
NetBox Logs
Content of docker-compose.override.yml
Beta Was this translation helpful? Give feedback.
All reactions