XF 2.2 Local dev environment recommendation 2020

@Kier I have a setup working within docker that I can share if you'd like. You can see the rough framework on this repo.

It just requires a copy of xenforo, and obviously docker installed :)

Uses an nginx -> php-fpm which is the same as how we run xenforo in production
 
If anybody is doing a fresh install and you can't get the debugger to connect, take note of the port number. Viewing the php info will show you which port number XDebug is listening on; compare the xdebug.client_port to the value in your launch.json file. At the moment (2020-12-13) the file in your launch.json file after a fresh install of everything is 9000 while XDebug 3.x is listening on 9003.

Either change the value in your launch.json file to 9003 or include the xdebug.client_port = 9000 entry in your php.ini as @mithril posted above. With XDebug 3 you don't need the xdebug.remote_enable or xdebug.remote_autostart lines specified in the video.




(On a different note, I regret not seeing Mithril's above post before I went nuts trying to figure out what was going on. 🤣)
 
@Kier, recommendation on what VS keymappings to use to be the same as the XF editor? I was trying to find if it was mentioned in the forums what mappings the XF the editor is using (eg: CTRL+D to delete a line) but didn't spot it. I'm thinking the Eclipse mapping? 🤔
 
@Kier, recommendation on what VS keymappings to use to be the same as the XF editor? I was trying to find if it was mentioned in the forums what mappings the XF the editor is using (eg: CTRL+D to delete a line) but didn't spot it. I'm thinking the Eclipse mapping? 🤔
When you say 'the XF editor' - are you referring to the WYSIWYG editor built into XF, or the CodeMirror code editor in XF, or the editor Mike, Chris and I use to actually edit the XF code? Sorry if I'm being slow...
 
When you say 'the XF editor' - are you referring to the WYSIWYG editor built into XF, or the CodeMirror code editor in XF, or the editor Mike, Chris and I use to actually edit the XF code? Sorry if I'm being slow...
I was thinking along the lines of the editor used in the ACP when, for example, editing templates and CTRL+D can be used to delete a line versus the defaults of VS Code where it's SHIFT+CTRL+K.

But it's all good, I think for me I'm going to try the default VS Code mappings for a bit. Between the day job and hobbies I've got way too many different editors so I think I'm going to try to see if I can standardize on VS Code for both work & home.
 
I'm just getting into setting up offline enviornment and see this new recommendation. What's the pros/cons of Laragon vs the previous recommendation of Scotchbox/Vagrant? My newbie guess is, Laragon approach is better positioned for deep code testing, especially toubleshooting/debugging? And Scotchbox is easier for us rookies?
 
If you like contaienrs -- you can use this docker compose file its origin is from xfrocks.
# https://github.com/xfrocks/docker-xenforo
They added a a niginx container infront but it wasn't working so i took it out.
API is available @ - http://localhost/index.php/api/

Code:
version: '2'
# https://github.com/xfrocks/docker-xenforo
 
services:
  php:
    image: xfrocks/xenforo:php-apache
    ports:
      - "80:80"
    links:
      - mysql
    volumes: 
      - ./:/var/www/html/
      
  mysql:
    image: mysql
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
      MYSQL_DATABASE: 'database'
      MYSQL_USER: 'user'
      MYSQL_PASSWORD: 'password'
    expose:
      - "3306"
    volumes:
      - ./internal_data/mysql:/var/lib/mysql
 
Is anyone using docker in production? I'm trying to write an addon to give access to subforums based on access levels in our existing database. We want a hybrid public-private membership forum. I'm trying to find the ideal way to run XenForo in docker for a production environment - not just dev - if anyone knows. I see there is no official docker image for XenForo :(
 
Is anyone using docker in production? I'm trying to write an addon to give access to subforums based on access levels in our existing database. We want a hybrid public-private membership forum. I'm trying to find the ideal way to run XenForo in docker for a production environment - not just dev - if anyone knows. I see there is no official docker image for XenForo :(
We run it within containers for production (https://7Cav.us)

What did you need help with? There’s no official container because that would easily leak the PHP source code for XF
 
We run it within containers for production (https://7Cav.us)

What did you need help with? There’s no official container because that would easily leak the PHP source code for XF
Thanks! An (officially blessed) Dockerfile to build an image for XF using the licensed download would be just as good. I'll try the repo you linked to in the beginning of this thread. In terms of what I'm trying to do: https://xenforo.com/community/threads/requirements-for-access-level-subforums-db-integration.206538/

Is the docker-compose.yml in your repo the same one you use to run XF in production?
 
Thanks! An (officially blessed) Dockerfile to build an image for XF using the licensed download would be just as good. I'll try the repo you linked to in the beginning of this thread. In terms of what I'm trying to do: https://xenforo.com/community/threads/requirements-for-access-level-subforums-db-integration.206538/

Is the docker-compose.yml in your repo the same one you use to run XF in production?

Not exactly, but close

I can go grab the compose we use for prod later today after work. However, we also use a nginx proxy in front of everything - so it may seem a little off

Though, it’s still the combo of its own nginx ‘sidecar’ and the fpm image for PHP
 
Not exactly, but close

I can go grab the compose we use for prod later today after work. However, we also use a nginx proxy in front of everything - so it may seem a little off

Though, it’s still the combo of its own nginx ‘sidecar’ and the fpm image for PHP
Great, that would be good to have - and perhaps we can get some other XF users to use the same production compose file to help keep an eye out for issues. I'll be using traefik in from of it rather than nginx.
 
Great, that would be good to have - and perhaps we can get some other XF users to use the same production compose file to help keep an eye out for issues. I'll be using traefik in from of it rather than nginx.
Sounds good

I looked into traefik, but the r/pm is seemingly slower than that of nginx

Would be good to hear more data points on how that setup works for you
 
Top Bottom