I have a dockerize Laravel Application and when I want to buidl its image I get an error about .env. I dont know how should I pass it to container. I keep .env in server in another path. (/var/env/.env)
deploy-job:
stage: deploy
image: docker:latest
only:
- feature/cicd
environment: production
script:
- echo "Deploying application..."
- cp /var/env/.env .env
- docker-compose -f docker-compose-prod.yml up -d
- echo "Application successfully deployed."
I get this error: no such file or directory.. whats the best practice for this problem?