Closed appreciated closed 3 months ago
I'm a bit confused by this. In production, the Plandex server looks for the file system at /plandex-server
by default:
From server/db/fs.go
:
var BaseDir string
func init() {
home, err := os.UserHomeDir()
if err != nil {
panic(fmt.Errorf("error getting user home dir: %v", err))
}
BaseDir = os.Getenv("PLANDEX_BASE_DIR")
if BaseDir == "" {
if os.Getenv("GOENV") == "development" {
BaseDir = filepath.Join(home, "plandex-server")
} else {
BaseDir = "/plandex-server"
}
}
}
In production on Plandex Cloud, the file system is mounted at /plandex-server
and it works. So why is /root/plandex-server
needed with docker-compose? Does it still end up as /plandex-server
from the server's perspective or does it also require that PLANDEX_BASE_DIR
is set to /root/plandex-server
?
I can test this but I want to be sure I understand the issue before merging. Ty!!
@danenania This was my own fault, thanks for clearing it up for me. I started the server in development mode. This happened since development
is the default value in _env
and I didn't bother to change it.
I think this could be avoided in future simply by changing the default to "production" in the _env
.
One question, why do you bother passing GOENV
into the docker container?
Wouldn't it be better to remove it completely from the _env
and setting it constant to "production" in the Dockerfile?
Using /root/ as the home directory inside the docker container does not seem useful to me.
This is a really nasty issue and easy to overlook. It causes the data in the docker container not to be persisted externally.
Important - If the docker compose file was used before:
Back up the data the following way:
Check if the folder
plandex-server-backup
contains a folderorgs
Start with the new configuration:
Apply the backup:
Related Issues
This is caused by the same issue mentioned in #9