Sign inSign up

afsharidevops/awx

By afsharidevops

Updated 10 months ago

awx:23.9.0

Image
Networking
Developer tools
Operating systems
0

1.0K

afsharidevops/awx repository overview

AWX 23.9.0 — Local Docker Compose with afsharidevops/awx:23.9.0

- ⚠️ For local development/demo only (use AWX Operator for production)

This guide mirrors the upstream tools/docker-compose flow for AWX 23.9.0, pins the custom image, and includes fixes for the common collectstatic / uWSGI crash loop (502/404).
It also adds key AWX initialization commands (clean-ui, ui-devel, createsuperuser, create_preload_data).

0) Prereqs

  • 🐧 Linux host with Docker and Docker Compose plugin (docker compose version)
  • 🧠 4+ vCPU, 6+ GB RAM recommended
  • 🔒 Ports free on host: 8043 (HTTPS UI)

1) Pull AWX source at 23.9.0

mkdir -p /opt/awx && cd /opt/awx
git clone https://github.com/ansible/awx.git
cd awx
git checkout 23.9.0
cd tools/docker-compose/_sources
pwd   # /opt/awx/awx/tools/docker-compose/_sources
ls -1

You should see: docker-compose.yml, nginx.conf, nginx.locations.conf, SECRET_KEY, websocket_secret.py, database.py, etc.

If SECRET_KEY or websocket_secret.py are missing, create them (any random non-empty strings are fine for local dev).

2) Pin your custom image in docker-compose.yml

sed -i 's|\(image:\s*\).*awx:.*|\1afsharidevops/awx:23.9.0|' docker-compose.yml

(Optional) add initial admin credentials if not present:

awk '
  BEGIN{p=1}
  /services:/ {print; next}
  /awx:/ && p {print; getline; print "    environment:"; print "      AWX_ADMIN_USER: admin"; print "      AWX_ADMIN_PASSWORD: changeme"; p=0}
  {print}
' docker-compose.yml > docker-compose.yml.new && mv docker-compose.yml.new docker-compose.yml

3) Start the stack

docker compose pull
docker compose up -d
docker compose logs -f awx

4) Initialize AWX and UI

After the container (tools_awx_1) is running, execute the following commands:

Rebuild the AWX UI assets to ensure proper frontend loading
docker exec tools_awx_1 make clean-ui ui-devel
Create the admin superuser (interactive)
docker exec -ti tools_awx_1 awx-manage createsuperuser
Preload default organizations, projects, and inventories
docker exec tools_awx_1 awx-manage create_preload_data

5) Access the UI

Open https://<HOST_IP>:8043 (accept the self-signed cert).
Login with your created superuser credentials.
If you used environment variables earlier, defaults are: admin / changeme

Health checks:

curl -k https://localhost:8043/api/v2/ping/
docker compose exec awx bash -lc 'curl -sS -i http://127.0.0.1:8050/api/v2/ping/ || true'

6) Volumes (persistent data)

  • PostgreSQL → pgdata
  • Redis → redisdata
  • Projects → awx_projects/var/lib/awx/projects
  • AWX data → awx_data/var/lib/awx
  • Static assets → awx_static/var/lib/awx/public/static

Backup example (pgdata):

docker compose stop awx
docker run --rm -v pgdata:/from -v "$(pwd)":/to alpine sh -c 'cd /from && tar czf /to/pgdata.tgz .'
docker compose start awx

7) Day-2 Operations

docker compose ps
docker compose logs -f awx
docker compose restart awx

Upgrade later:

sed -i 's|afsharidevops/awx:23.9.0|afsharidevops/awx:<NEW_TAG>|' docker-compose.yml
docker compose pull awx && docker compose up -d

8) Troubleshooting — 502/404 (uWSGI / collectstatic loop)

Symptoms:

  • Browser shows 502 Bad Gateway or 404 Not Found
  • supervisorctl status: tower-processes:awx-uwsgi FATAL
  • /var/log/nginx/error.log: no live upstreams or connect() failed (111)

Root cause: The supervisor target runs: python3.9 manage.py collectstatic --clear --noinput If this fails (wrong interpreter, missing Django, etc.), uWSGI dies → nginx 502/404.

Fix flow (inside container):

docker compose exec awx bash
supervisorctl status
tail -n 200 /var/log/nginx/error.log || true
python3.9 manage.py collectstatic --clear --noinput
Expect: "121 static files copied to '/var/lib/awx/public/static'."
supervisorctl restart tower-processes:awx-uwsgi
ss -ltnp | grep 8050 || echo "uWSGI not listening yet"
curl -sS -i http://127.0.0.1:8050/api/v2/ping/ || echo "ping failed"

If port 8050 stuck/in-use:

supervisorctl stop tower-processes:awx-uwsgi || true
pkill -9 -f 'uwsgi.*tower/uwsgi.ini' || true
pkill -9 -x uwsgi || true
supervisorctl start tower-processes:awx-uwsgi

Still failing?

  • Ensure /var/lib/awx/public/static is writable and mapped to awx_static volume.
  • Re-run collectstatic then restart uwsgi.
  • Inspect logs:
docker compose logs awx | tail -n 300
tail -n 200 /var/log/nginx/error.log

9) Security Notes

  • This compose is for local development/demos. For production use AWX Operator.
  • Change defaults (SECRET_KEY, passwords) if exposing beyond localhost.

10) Image Info

Tag summary

Content type

Image

Digest

sha256:5f3ea5c69

Size

791.3 MB

Last updated

10 months ago

docker pull afsharidevops/awx:23.9.0