How to properly update the .env
file
There are a few commands that are required to run to correctly update the .env file.
1. Stop your SnailyCAD instance
Before we can edit the .env
file, we must first stop SnailyCAD.
Make sure you are in the same directory as your SnailyCAD instance.
- Standalone
- Docker
If you are running SnailyCAD standalone, you can simply press CTRL+C
in the terminal window where SnailyCAD is running.
If you are running SnailyCAD with Docker, you can stop SnailyCAD by running the following command:
docker compose -f production.docker-compose.yml down
2. Update the ENV file
Now that SnailyCAD is stopped, we can update the .env
file.
3. Building and copying
Now that we have updated the .env
file, we need to rebuild the client and copy the .env
file to the client and API.
- Standalone
- Docker
If you are running SnailyCAD standalone, you can run the following command to rebuild the client:
node scripts/copy-env.mjs --client --api && pnpm run build
If you are running SnailyCAD with Docker, you can run the following command to rebuild the client:
node scripts/copy-env.mjs --client --api && docker compose -f production.docker-compose.yml build
4. Start SnailyCAD
Now that we have updated the .env
file, we can start SnailyCAD again.
- Standalone
- Docker
If you are running SnailyCAD standalone, you can run the following command to start SnailyCAD:
pnpm run start
If you are running SnailyCAD with Docker, you can run the following command to start SnailyCAD:
docker compose -f production.docker-compose.yml up -d