Closed W4JEW closed 2 years ago
Well, turns out I was correct - there's one step that's missing from your documentation..
The documentation states:
If you go with the provided docker-compose.yml file you don't need to worry about these - they're included and already configured to work with this app.
This is not accurate. There's no mention of having to edit the docker-compose.yml file to include an environment setting and it's not included in the version downloaded via using the git clone command.
It's necessary to specify an authentication parameter in docker-compose.yml, otherwise PostgreSQL doesn't start completely and there's a cascading effect where the other asciinema containers fail.
This is the docker-compose.yml file included with asciinema-server:
services:
postgres:
image: postgres:12-alpine
environment:
POSTGRES_HOST_AUTH_METHOD: trust
container_name: asciinema_postgres
restart: unless-stopped
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
### See https://hub.docker.com/_/postgres/ for more
### configuration options for this image.
This is a working example... Note the addition of:
environment:
POSTGRES_HOST_AUTH_METHOD: trust
services:
postgres:
image: postgres:12-alpine
environment:
POSTGRES_HOST_AUTH_METHOD: trust
container_name: asciinema_postgres
restart: unless-stopped
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
### See https://hub.docker.com/_/postgres/ for more
### configuration options for this image.
Adding those two lines made all the difference. Please update your included docker-compose.yml file or omit/modify the following since it's not accurate:
If you go with the provided docker-compose.yml file you don't need to worry about these - they're included and already configured to work with this app.
I accidentally closed this issue. Reopening to ensure this issue gets resolved. See my follow-up comment.
From what I see in the logs for the containers, it looks like the documentation is missing several mandatory configuration options.
I think the first one that's the deal breaker is for Postgres (see below for the logs)
And anything else that attempts to start after postgres fails because the database wasn't created.
I've followed the instructions available here pretty much verbatim: https://github.com/asciinema/asciinema-server/wiki/Installation-guide
I'm trying to install the Docker container on Ubuntu 20.04. Once I clone the repository, I made a copy of .env.production.sample and configured the following parameters:
URL_SCHEME=http URL_HOST=
URL_PORT=80
SECRET_KEY_BASE= <ran docker-compose run --rm phoenix gen_secret to generate the secret and pasted it here> DATABASE_URL=
SIGN_UP_DISABLED=true
ASCIICAST_GC_DAYS=7
MAILNAME=mailhost.domain.com SMTP_FROM_ADDRESS=me@domain.com SMTP_REPLY_TO_ADDRESS=me@domain.com
GMAIL_USER= <set to my Google Workspace user ID: admin@domain.com> GMAIL_PASSWORD = should be obvious
All of the AWS S3 attributes were left commented out.
Then I ran docker pull asciinema/asciinema-server:latest to download the latest image. This wasn't really needed since the command to generate the secret key already downloaded the image.
FYI - running the docker command to generate the secret key also downloaded the Docker containers and both Postgres and SMTP were running.
Created the postgres container: docker-compose up -d postgres
I removed the SMTP container, then ran docker-compose up -d to start everything.
That's pretty much it - and every time I try to connect to the server via http:// URL I get the Nginx 502 error. I can't figure out what's breaking.
When I look at the logs for the nginx container, I see: