Strapi production environment

Hi guys, I'm using railway to deploy Strapi, I used the 1-click template provided on Railway. I want to be sure I'm doing things correctly and I find it quite confusing to understand whether I'm using development or production mode. So I run "railway run yarn run develop" locally, then access Strapi through the tcp proxy at http://127.0.0.1:1337/admin. That's where I'm supposed to do all my changes, and it's in development mode. Then I have to push my changes with the github repo, to the main branch, and railway takes care of updating the production mode. Is that right? I see a branch "dependabot/npm_and_yarn/strapi-xxx" that gets updated automatically when I push to main. But then why do I only see a development config in /config in my repo? There is no /config/env/production, only /config/env/development. Could someone enlighten me, and is there a place where al this dev/prod micmac and setup is explained clearly?
7 Replies
Percy
Percy5mo ago
Project ID: N/A
tqw4gsargars
tqw4gsargars5mo ago
N/A
Brody
Brody5mo ago
the different configs are so that during locally development strapi connects to the database on railway via the public tcp proxy, and then when on railway in production mode it will connect to the database via the private network
tqw4gsargars
tqw4gsargars5mo ago
@Brody thanks for your response. So there's a problem if I'm not seeing the production environment variable right?
Brody
Brody5mo ago
have you read the template's overview on developing locally? I think it provides a very easy to follow step by step guide on how to develop locally, no code changes are required, just run the commands in the guide and when done push your changes to github and it will be ran in production mode on railway! https://railway.app/template/strapi
tqw4gsargars
tqw4gsargars5mo ago
Yes I've read it, thanks for the link! I got confused because I saw example of deployements with both dev and prod environments, while I didn't see both in my own project.
Brody
Brody5mo ago
that's alterations I've done for the strapi template so it works perfectly with railway and how you do development with the platform, a stock strapi app wouldn't come with such things