Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep all wordpress_sites in one VM #520

Closed
jasperf opened this issue Mar 6, 2025 · 1 comment
Closed

Keep all wordpress_sites in one VM #520

jasperf opened this issue Mar 6, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@jasperf
Copy link

jasperf commented Mar 6, 2025

Summary

I wanted to add a subdomain blocks.imagewize.com to same Trellis project where I had imagewize.com. So I added it using composer create-project roots/bedrock blocks . I also adjusted the wordpress_sites.yaml

# Created by trellis-cli v1.13.0
# Documentation: https://roots.io/trellis/docs/wordpress-sites/

wordpress_sites:
  imagewize.com:
    site_hosts:
    - canonical: imagewize.test
      redirects:
      - www.imagewize.test
    local_path: ../site
    admin_email: [email protected]
    multisite:
      enabled: false
    ssl:
      enabled: false
      provider: self-signed
    cache:
      enabled: false
  blocks.imagewize.com:
    site_hosts:
    - canonical: blocks.imagewize.test
      redirects:
      - www.blocks.imagewize.test
    local_path: ../blocks
    admin_email: [email protected]
    multisite:
      enabled: false
    ssl:
      enabled: false
      provider: self-signed
    cache:
      enabled: false

I wanted to restart the vm so did trellis vm start. But instead of restarting the existing imagewize.com virtual machine it created a new machine

limactl list
NAME                    STATUS     SSH                VMTYPE    ARCH       CPUS    MEMORY    DISK      DIR
blocks.imagewize.com    Running    127.0.0.1:57764    vz        aarch64    4       4GiB      100GiB    ~/.lima/blocks.imagewize.com
imagewize.com           Stopped    127.0.0.1:0        vz        aarch64    4       4GiB      100GiB    ~/.lima/imagewize.com
....

And that also caused load issues as I guess the Nginx configuration of the existing virtual machine and new one clashed.

cat ~/.lima/blocks.imagewize.com/lima.yaml
vmType: "vz"
rosetta:
  enabled: false
images:
- location: https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
  arch: x86_64
- location: https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-arm64.img
  arch: aarch64

mounts:
- location: /Users/me/code/imagewize.com/blocks
  mountPoint: /srv/www/blocks.imagewize.com/current
  writable: true
- location: /Users/me/code/imagewize.com/site
  mountPoint: /srv/www/imagewize.com/current
  writable: true

mountType: "virtiofs"
ssh:
  forwardAgent: true
  loadDotSSHPubKeys: true
networks:
- vzNAT: true
containerd:
  user: false
provision:
- mode: system
  script: |
    #!/bin/bash
    echo "127.0.0.1 $(hostname)" >> /etc/hosts

But main issue is that I need to be able to run multiple sites on one Trellis setup and so also on one macOS virtual machine.

Additional context

Also see https://discourse.roots.io/t/trellis-vm-main-domain-subdomain-same-virtual-machine/29340 where I wrote a bit more

@jasperf jasperf added the enhancement New feature or request label Mar 6, 2025
@retlehs retlehs changed the title Main Domain incl Subdomain in one Trellis Lima VM Keep all wordpress_sites in one Trellis Lima VM Mar 6, 2025
@retlehs retlehs changed the title Keep all wordpress_sites in one Trellis Lima VM Keep all wordpress_sites in one VM Mar 6, 2025
@retlehs
Copy link
Member

retlehs commented Mar 7, 2025

See #514

@retlehs retlehs closed this as completed Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants