Thank you @Falco! I’ve got it working on a very restricted RHEL VM and a Ubuntu 18.04 VM with access to everything (for generating the image), using the supported installation method (discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub). The missing /sbin/boot command was what caused the github.com access error.
In summary and for documentation; the steps needed to create and image and run it on my server:
- Clone discourse:
git clone https://github.com/discourse/discourse_docker.git /var/discourse && cd /var/discourse
- Configure with default values
./discourse-setup
- Tweak the default discourse configuration (optional)
nano /var/discourse/containers/app.yml
- Get the local_discourse/app IMAGE ID (something like b6fa739cedf5)
docker images -a
- Create your own tag for the image with the IMAGE ID
docker tag b6fa739cedf5 your-registry-url.com/namespace/image-name
- Push your image to your registry (you might need to login with docker login https://your-registry-url.com first)
docker push your-registry-url.com/namespace/image-name
- On the server you’d like to create the discourse container, create a docker-compose.yaml file for your application (configure it to your specifications with something like…)
version: '3'
services:
discourse:
container_name: discourse_docker_custom
image: 'your-registry-url.com/namespace/image-name:latest'
restart: always
shm_size: 512m
command: /sbin/boot
ports:
- '80:80'
- '443:443'
volumes:
- '/shared:/var/discourse/shared/standalone'
environment:
- DISCOURSE_DEVELOPER_EMAILS=admin@email-address.com
- DISCOURSE_SMTP_AUTHENTICATION=none
- DISCOURSE_SMTP_OPENSSL_VERIFY_MODE=none
- DISCOURSE_SMTP_ADDRESS=localhost
- DISCOURSE_SMTP_PORT=25
- DISCOURSE_SMTP_USER_NAME=
- DISCOURSE_SMTP_PASSWORD=
- DISCOURSE_SMTP_ENABLE_START_TLS=true
- DISCOURSE_HOSTNAME=your.server.com
networks:
- discourse
networks:
discourse:
driver: bridge
- Install docker-compose (Overview of installing Docker Compose | Docker Docs) and run (within the directory that contains the docker-compose.yaml file):
docker-compose up -d
…and you’ll be up and running.