Add production support and update environment configurations#10
Add production support and update environment configurations#10
Conversation
- Enhance README with production mode instructions - Modify entrypoint scripts to handle production environment - Update Dockerfile to create access logs directory - Change Django settings module path in ASGI and WSGI files - Adjust static file paths in Django settings - Introduce docker-compose configuration for production - Add script to run development servers for client and server
docker-compose.prod.yml
Outdated
| client: | ||
| container_name: wajo-client | ||
| build: | ||
| context: . | ||
| dockerfile: ./docker/client/Dockerfile | ||
| restart: unless-stopped | ||
| env_file: ./client/.env | ||
| ports: | ||
| - 3000:3000 | ||
| volumes: | ||
| - ${LOCAL_WORKSPACE_FOLDER:-.}/client:/app | ||
| - ignore:/app/node_modules | ||
| volumes: | ||
| ignore: No newline at end of file |
There was a problem hiding this comment.
you're planning to host the client in the vps too?
docker-compose.prod.yml
Outdated
| server: | ||
| container_name: wajo-server | ||
| build: | ||
| context: . | ||
| dockerfile: ./docker/server/Dockerfile | ||
| restart: unless-stopped | ||
| env_file: ./server/.env | ||
| ports: | ||
| - 8000:8000 | ||
| volumes: | ||
| - ${LOCAL_WORKSPACE_FOLDER:-.}/server:/app |
There was a problem hiding this comment.
this is not going to work... you're going to need to have a nginx setup
There was a problem hiding this comment.
nginx needs to be infront to serve traffic, and will need to serve the static files as well
|
i don't know where you modelled this change, but i expect it to be similar to this https://github.com/codersforcauses/csf/blob/main/docker-compose-prod.yml |
docker-compose.prod.yml
Outdated
| container_name: wajo-server | ||
| build: | ||
| context: . | ||
| dockerfile: ./docker/server/Dockerfile |
There was a problem hiding this comment.
no... DO NOT build the docker image in the VPS...
Get it to pull from a docker image
There was a problem hiding this comment.
the reason why you don't do that is:
- you want replicability by getting what worked in the artifact
- building docker image requires lots of resource that your vps server may not have more
- you'll want something like watchtower to do continuous deployment (which it relies on it coming from artifact store such as docker registry)
|
In production , you'll also need to push to docker registry https://github.com/codersforcauses/csf/blob/main/.github/workflows/docker-build.yml |
Change Summary
Change Form
NA
Other Information
Please review the code relating to the WSGI part and the files' changes in
docker/server/