Knox
Knox
Explore posts from servers
RRailway
Created by Knox on 6/14/2023 in #✋|help
Release Go app with Docker and godotenv
I did this:
if os.Getenv("APP_ENV") == "dev" {
err := godotenv.Load("dev.env")
if err != nil {
fmt.Println(err)
log.Fatal("Error loading dev.env file")
}
}
if os.Getenv("APP_ENV") == "dev" {
err := godotenv.Load("dev.env")
if err != nil {
fmt.Println(err)
log.Fatal("Error loading dev.env file")
}
}
So the dev.env is only applied in development mode. Just a workaround for this api that I actually want to have in production and deploy a mobile / web app asap.
11 replies
RRailway
Created by Knox on 6/14/2023 in #✋|help
Release Go app with Docker and godotenv
Platform is great. I just haven’t touched Docker and Docker compose since school. It’s a skill issue. The reason why I dont copy the .env is because it’s supposed to not be a “good” practice to do so… but I’m far from being on my comfort zone on this to know for sure.
11 replies
RRailway
Created by Knox on 6/14/2023 in #✋|help
Release Go app with Docker and godotenv
N/A
11 replies