Closed Pingumania closed 4 years ago
You must include env_file: .env
in the wreeto
container, otherwise Rails will not be able to find the POSTGRES_
vars included in the database.yml
file: https://github.com/chrisvel/wreeto_official/blob/master/config/database.yml.
Or If you prefer you can add them to an environment:
key in the docker-compose.yml
file as you already did for wreeto-db
.
if I do it like this the env variables seem to be ignored because it tries to find wreeto_dev
wreeto | ActiveRecord::NoDatabaseError: FATAL: database "wreeto_dev" does not exist
wreeto:
image: chrisvel/wreeto:latest
container_name: wreeto
depends_on:
- wreeto-db
- redis
networks:
- internal
- proxy
env_file:
- /opt/docker/wreeto/.env
volumes:
- /opt/docker/wreeto/docker-entrypoint.sh:/app/wreeto/docker-entrypoint.sh
# - /opt/docker/wreeto/.env:/app/wreeto/.env
command: foreman start
labels:
- traefik.enable=true
- traefik.http.routers.wreeto.entrypoints=web,web-secure
- traefik.http.routers.wreeto.rule=Host(`wreeto.example.com`)
- traefik.http.routers.wreeto.tls.domains[0].main=example.com
- traefik.http.routers.wreeto.tls.domains[0].sans=*.example.com
- traefik.http.services.wreeto.loadbalancer.server.port=8383
- traefik.http.services.wreeto.loadbalancer.server.scheme=http
same with
wreeto:
image: chrisvel/wreeto:latest
container_name: wreeto
depends_on:
- wreeto-db
- redis
networks:
- internal
- proxy
# env_file:
# - /opt/docker/wreeto/.env
environment:
- OAUTH_GOOGLE_ID=
- OAUTH_GOOGLE_SECRET=
- POSTGRES_HOST=wreeto-db
- POSTGRES_USER=wreeto
- POSTGRES_PASSWORD=***
- POSTGRES_DB=wreeto_db
- POSTGRES_PORT=5432
- RACK_ENV=development
- RAILS_ENV=development
- RECAPTCHA_SITE_KEY=
- RECAPTCHA_SECRET_KEY=
- REDIS_HOST=redis
- REDIS_PASSWORD=
- SMTP_USERNAME=
- SMTP_PASSWORD=
- WREETO_HOST=wreeto.my.domain
- WREETO_PORT=8383
volumes:
- /opt/docker/wreeto/docker-entrypoint.sh:/app/wreeto/docker-entrypoint.sh
# - /opt/docker/wreeto/.env:/app/wreeto/.env
command: foreman start
You are correct, wreeto_dev
is forgotten here: https://github.com/chrisvel/wreeto_official/blob/48139da80fa791f43f8201bfdebcebd9f84a9d65/config/database.yml#L13
I will replace it with the ENV['POSTGRES_DB']
var asap.
docker-compose.yml
.env
error