-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add production support and update environment configurations #10
base: main
Are you sure you want to change the base?
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
@@ -39,9 +39,9 @@ fi | |||
# Run Django/Gunicorn | |||
# =================== | |||
if [ "${APP_ENV^^}" = "PRODUCTION" ]; then | |||
|
|||
su - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need to run root?
@@ -17,5 +17,7 @@ RUN poetry install | |||
|
|||
COPY ./server ./ | |||
|
|||
RUN mkdir -p /var/log/accesslogs && chmod -R 777 /var/log/accesslogs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the problem with the perms?
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're planning to host the client in the vps too?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not going to work... you're going to need to have a nginx setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
container_name: wajo-server | ||
build: | ||
context: . | ||
dockerfile: ./docker/server/Dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/