Replies: 11 comments
-
I see there used to be a Production Guide - where is this now? All the links to it are dead. |
Beta Was this translation helpful? Give feedback.
-
I can now connect, I figured out the issue. But now I get a real specific error to the code;
|
Beta Was this translation helpful? Give feedback.
-
@JHenzi I'm having the same error. Did you ever get anywhere on this?
version: '3'
volumes:
mastodon:
services:
mastodon:
image: tootsuite/mastodon
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
depends_on:
- postgres
- redis
volumes:
- mastodon:/mastodon/public/system
ports:
- '3000:3000'
environment:
REDIS_HOST: 192.168.0.14
REDIS_PORT: 6379
DB_HOST: 192.168.0.14
DB_USER: $DEV_NAME
DB_NAME: mastodon
DB_PASS: $POSTGRES_PW
DB_PORT: 5432
OTP_SECRET: $OTP_SECRET
SECRET_KEY_BASE: $SECRET_KEY_BASE |
Beta Was this translation helpful? Give feedback.
-
Possibly outdated Docker guide: https://github.com/tootsuite/documentation/blob/archive/Running-Mastodon/Docker-Guide.md Up-to-date installation guide for a normal (non-Docker) setup: https://docs.joinmastodon.org/admin/install/ The gist is that you've likely not run any setup command so your database is completely blank. You may missing other configuration too, for example, if the above comment is all environment variables you've got, you're missing many required ones, the structure also doesn't look too familiar, Mastodon already comes with a docker-compose.yml file that's a good template. |
Beta Was this translation helpful? Give feedback.
-
@Gargron Still no luck following the guide. Here's my issue for what its worth https://discourse.joinmastodon.org/t/docker-setup-error-domain-name/2051 |
Beta Was this translation helpful? Give feedback.
-
I was able to run the setup in docker which removed the issue, corrected docker to look at "db" as host instead of running in /var and I got as far as getting a too many redirects issue. I'm unsure how to resolve that one. |
Beta Was this translation helpful? Give feedback.
-
I ran into that same issue while trying to setup Mastodon on my minikube Kubernetes cluster. I resolved it by first manually starting the Mastodon deployment with a fake command that runs forever:
That allowed the Pod to startup up successfully so that I could manually shell into it with
Once in the container, I verified the running user is
And ran the following command to do the initial setup (generate .env.production and setup db schema) See: https://docs.joinmastodon.org/admin/install/
I guess this needs to be done manually once to generate the initial db schema. It would be nice if the docker image could somehow detect that the db doesn't have a schema yet and generate it automatically, but that doesn't appear to be the case. Anyway, after that my Pod is at least staying up (I haven't checked if it actually works yet - still need some more k8s configs before I get there). Here is my k8s for Mastodon-web deployment in case that helps anyone:
|
Beta Was this translation helpful? Give feedback.
-
Why are people giving thumbs down to @thomasmarkiewicz's comment? I had to do the same thing to get my instance running. I couldn't find any good documentation on using the docker-compose file so I hacked what I found into my existing linuxserver.io file... |
Beta Was this translation helpful? Give feedback.
-
use or do this before deploy mastodon
|
Beta Was this translation helpful? Give feedback.
-
Iam blocked here as well, but after implemented all the changes manually, it still stucks with missing the "db". I updated compose.yml and the env production file in several different ways around. Maybe some ideas to solve it?
If env production is set back to /var... for DB_HOST:
Lets get more over the mastodon:setup
|
Beta Was this translation helpful? Give feedback.
-
this worked for me! I used |
Beta Was this translation helpful? Give feedback.
-
Expected behaviour:
Connection to database from inside container is seamless
Actual behaviour
web_1 | /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in
initialize': could not connect to server: No such file or directory (PG::ConnectionBad)web_1 | Is the server running locally and accepting
web_1 | connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
`
Steps to reproduce the problem
Build tootsuite from docker compose here (after setting environment details): https://github.com/tootsuite/mastodon
Specifications
Latest, if needed can paste Docker Compose
Have read some guides, PG setup should be not needed, though have set in compose and in the environment variables a password and no password. All containers share the local network.
Beta Was this translation helpful? Give feedback.
All reactions