services: codex: # Podman compose (rootless): keep host UID/GID ownership on mounted files userns_mode: keep-id build: . image: codex container_name: openai-codex volumes: # Mount your project directory (or use ./workspace) - .:/workspace # Share your host's Codex config (instructions, history, OAuth tokens) - ~/.codex:/home/coder/.codex # SSH keys for git operations (read-only) - ~/.ssh:/home/coder/.ssh:ro # Git configuration (read-only) - ~/.gitconfig:/home/coder/.gitconfig:ro environment: # Set your OpenAI API key (not needed if using OAuth) - OPENAI_API_KEY=${OPENAI_API_KEY:-} ports: # OAuth callback port - "1455:1455" stdin_open: true tty: true working_dir: /workspace # Uncomment for OAuth login # network_mode: host # Alternative: Use named volume instead of host mount codex-fresh: userns_mode: keep-id build: . image: codex container_name: openai-codex-fresh volumes: - .:/workspace - codex-config:/home/coder/.codex - ~/.ssh:/home/coder/.ssh:ro - ~/.gitconfig:/home/coder/.gitconfig:ro environment: - OPENAI_API_KEY=${OPENAI_API_KEY} ports: - "1455:1455" stdin_open: true tty: true working_dir: /workspace profiles: - fresh volumes: codex-config: name: codex-config