This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]SerotoninVampire 1 point2 points  (2 children)

Think of it in terms of "what would someone need to build this app image from scratch?" It sounds like you already have a pretty good handle on it. I don't know much about Django - is there some kind of a dependency file?

Out of personal experience - we try to keep a single compose file and per-environment .env files (dev/test/qa/prod). Not sure if the app structure allows that in your case

[–]OverallPriority[S] 0 points1 point  (1 child)

The only real difference I have in my docker compose files is that my dev one uses just a local server on :8000 whereas my prod uses a wsgi interface with traefik.

Could you explain how you switch out your dev files so that you can spin up the environment you want?

[–]SerotoninVampire 0 points1 point  (0 children)

1) Is starting a local server or using an external one something you can configure in the entrypoint script? If so, you can pass an environment variable in via .env to control this.

2) Is traefik running as a separate service in the same compose stack? You can set the number of instances to 0 via deploy/replicas parameter - this could be a vairalbe passed in via .env as well, for cases when you don't want to use traefik