I am not able to wrap my brain around the deployment on different servers. I want to have a public interface, the management of the data has to happen in a private network.
Am I right that
- I need two distinct
config/server.js at build time, one for the API (backend) and one for the adminpanel
- I can use environment varaibles here
- for the backend the
url parameter is the fully qualified user-visible URL
- for the adminpanel the
url parameter is the fully qualified user-visible backend URL
- the
config/database.js and config/admin.js can be configured at runtime
- the
url parameter in both config/admin.js can be the fully qualified frontend URL
- I have to build twice with the different
config/server.js files
-
yarn install --frozen-lockfile --production for the backend
-
yarn install --frozen-lockfile + yarn build for the admin panel instance
- the instances share the same database
Or did I get something completely wrong?
- the
url parameter in both config/admin.js can be the fully qualified frontend URL
Unfortunately this is not true. If I use the backend URL for the admin panel any link is built with the “wrong” prefix.
1 Like
Solved
I managed to answer my questions on my own, I was completely wrong.
- there is just one
config/server.js at build time
- one has to build once, the admin panel is just a static HTML app without any additional config, that can be deployed anywhere using the API
From my perspective the docs are not very distinct here:
After running yarn build with this configuration, the build folder will be created/overwritten. Use this folder to serve it from another server with the domain of your choice (e.g. http://yourfrontend.com).
It contains any required information and I had read it many times, but I frequently missed its importance.
1 Like
I agree, the documentation can certainly do with some improvement. I find out about a lot of features and important information either by perusing other Strapi solutions, and forum articles, or reading the source code directly.
1 Like