8 months ago
For my deployment, I need to move some dot-env files into my container as below;
# Copy source code and production environment file
COPY src/ ./src/
COPY .env.prod ./But the file is not appearing on the server, then I saw the .dockerignore file is included during my build, even though I don't have it in my project. How can I disable this functionality? Is it even possible?
[Region: us-west1]
=========================
Using Detected Dockerfile
=========================
context: xctc-DXsJ
[internal] load build definition from Dockerfile
[internal] load build definition from Dockerfile ✔ 0ms
[internal] load build definition from Dockerfile
[internal] load build definition from Dockerfile ✔ 10ms
[internal] load metadata for docker.io/library/python:3.11-slim
[internal] load metadata for docker.io/library/python:3.11-slim ✔ 245ms
[internal] load .dockerignore
[internal] load .dockerignore ✔ 0ms
[internal] load .dockerignore
[internal] load .dockerignore ✔ 8msPinned Solution
8 months ago
Sorry I read back my message and it sounded a bit aggressive
. Wanted to rephrase that a bit.
Is there something in your code that could be moved to use railways variables system?
https://docs.railway.com/guides/variables
its overall a better idea for security then pushing .env files to prod 
3 Replies
8 months ago
May I ask why you need to move the .env files into the container? Usually you set variables in the project settings and you can read them in your program. You shouldnt be pushing to the git repo your .env files which means you shouldnt be copying it.
noahd
May I ask why you need to move the .env files into the container? Usually you set variables in the project settings and you can read them in your program. You shouldnt be pushing to the git repo your .env files which means you shouldnt be copying it.
8 months ago
There's no specific reason but I design my system in order to put some application configurations and some cliend ids...
fehmisener
There's no specific reason but I design my system in order to put some application configurations and some cliend ids...
8 months ago
Sorry I read back my message and it sounded a bit aggressive
. Wanted to rephrase that a bit.
Is there something in your code that could be moved to use railways variables system?
https://docs.railway.com/guides/variables
its overall a better idea for security then pushing .env files to prod 
Status changed to Solved chandrika • 8 months ago