Update Docker Documentation to Address Line Ending Issues for Windows Users
- Added a warning for Windows users regarding the importance of maintaining LF (Unix-style) line endings in script files to prevent Docker containers from hanging during startup. - Included instructions for configuring Git to preserve line endings and fixing the artisan script using dos2unix or sed commands. - Added a note about potential line ending issues that may arise when using Git or code editors on Windows, emphasizing the need for LF line endings in the `artisan` script. These changes aim to improve the documentation clarity and assist users in resolving common issues related to line endings when deploying with Docker.
This commit is contained in:
@@ -19,6 +19,19 @@ Looking to develop OpnForm locally? Check out our [Docker Development Setup](/de
|
||||
cd OpnForm
|
||||
```
|
||||
|
||||
<Warning>
|
||||
**Important for Windows Users**: Ensure script files maintain LF (Unix-style) line endings. If you're using Windows, configure Git to preserve line endings:
|
||||
```bash
|
||||
git config core.autocrlf false
|
||||
```
|
||||
And check/fix the artisan script before running setup:
|
||||
```bash
|
||||
# Using Git Bash or WSL
|
||||
dos2unix api/artisan
|
||||
```
|
||||
Otherwise, Docker containers may hang at "Waiting for DB to be ready" during startup.
|
||||
</Warning>
|
||||
|
||||
2. Run the setup script:
|
||||
```bash
|
||||
chmod +x scripts/docker-setup.sh
|
||||
@@ -195,6 +208,22 @@ docker compose exec db pg_isready
|
||||
docker compose logs db
|
||||
```
|
||||
|
||||
If the API container is stuck on "Waiting for DB to be ready":
|
||||
```bash
|
||||
# Check for line ending issues in the artisan script
|
||||
# The file should use LF (Unix) line endings, not CRLF (Windows)
|
||||
|
||||
# Fix line endings on Unix/Mac:
|
||||
sed -i 's/\r$//' api/artisan
|
||||
|
||||
# Fix line endings on Windows (using Git Bash or WSL):
|
||||
dos2unix api/artisan
|
||||
```
|
||||
|
||||
<Note>
|
||||
**Line Ending Issue**: When using Git or code editors on Windows, line endings in the `artisan` script may be converted from LF (Unix-style) to CRLF (Windows-style). This prevents the Docker container from properly executing the script, causing it to hang at "Waiting for DB to be ready". Always ensure script files maintain LF line endings.
|
||||
</Note>
|
||||
|
||||
### Cache Issues
|
||||
|
||||
Clear various caches:
|
||||
|
||||
Reference in New Issue
Block a user