-
Notifications
You must be signed in to change notification settings - Fork 3
Add Docker deployment with JSP hot-reload for rapid UI development #339
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
Conversation
Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
…d version field Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
|
@copilot I ran ./docker/quick-start.sh but there was a problem: |
Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
... Fixed in commit 67ff958. The schema SQL file ( Added
This allows the schema to load successfully while maintaining the |
|
@copilot there was a problem launching Tomcat. Make sure you are not reinventing the wheel - if need be, consult the GitHub Action YAML file to understand how a working Tomcat can be launched for this web app. This was the error I saw: |
|
@copilot Sorry, here is the full trace: |
…tibility flags Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
Fixed in commit 498aa00. The issue was caused by trying to add a duplicate Changes made based on the GitHub Actions workflow:
The Dockerfiles now use the same JVM flags as the working GitHub Actions deployment. |
... This error was already fixed in commit 498aa00, but you're seeing it because Docker is using a cached image built before the fix. To pick up the changes, rebuild the Docker image: # Stop and remove containers and volumes
docker compose down -v
# Rebuild the image (force no cache)
docker compose --profile development build --no-cache
# Start fresh
docker compose --profile development upThe |
|
@copilot still happening: |
... You need to pull the latest code from the PR branch. The fix in commit 498aa00 is in the repository but your local copy appears to be outdated. Run these commands to get the fix: # Ensure you have the latest code
git fetch origin
git checkout copilot/add-dockerfile-for-web-app
git pull origin copilot/add-dockerfile-for-web-app
# Verify the fix is present (should see NO sed command)
grep -n "sed" Dockerfile.dev
# Clean up old Docker artifacts
docker compose down -v
docker system prune -af
# Rebuild from scratch
docker compose --profile development build --no-cache
# Start
docker compose --profile development upThe |
|
@copilot tomcat launches but I get a 404 and the following error: What do I need to check? |
... The "listeners failed to start" error typically indicates missing dependencies or configuration issues. Check the following:
docker compose logs web-dev | grep -A 20 "SEVERE"
docker exec -it treebase-web-dev ls -la /usr/local/tomcat/webapps/treebase-web/WEB-INF/
docker compose logs web-dev | grep "BUILD SUCCESS"The full log output will show which specific listener failed and why. Share the complete error trace from the logs (not just the SEVERE lines) and I can help diagnose the specific issue. |
|
@copilot |
To access the localhost log files, use these commands: # List all log files in the container
docker exec -it treebase-web-dev ls -la /usr/local/tomcat/logs/
# View the localhost log (replace the date with actual file)
docker exec -it treebase-web-dev cat /usr/local/tomcat/logs/localhost.$(date +%Y-%m-%d).log
# Or tail it to see recent entries
docker exec -it treebase-web-dev tail -100 /usr/local/tomcat/logs/localhost.$(date +%Y-%m-%d).log
# View all logs at once
docker exec -it treebase-web-dev sh -c "cat /usr/local/tomcat/logs/*.log"Alternatively, copy the log files to your host: docker cp treebase-web-dev:/usr/local/tomcat/logs/ ./tomcat-logs/
ls -la ./tomcat-logs/
cat ./tomcat-logs/localhost.*.logShare the output and I can identify the specific initialization failure. |
|
@copilot from localhost.*.log: |
... The issue is a missing JavaMelody JAR in WEB-INF/lib. This happens because the volume mount for JSP files might be interfering with the WEB-INF directory structure. Verify the libraries were copied: docker exec -it treebase-web-dev ls -la /usr/local/tomcat/webapps/treebase-web/WEB-INF/lib/ | grep javamelodyIf the directory is empty or missing javamelody, restart the container to re-run the entrypoint script: docker compose restart web-dev
docker compose logs -f web-devIf it still fails, the issue is the volume mount overwriting WEB-INF. Check the docker-compose volume configuration: grep -A5 "web-dev:" docker-compose.yml | grep -A10 volumesThe WEB-INF/lib and WEB-INF/classes are mounted as separate volumes to prevent this exact issue. If those volumes are empty, the entrypoint script needs to run successfully. Share the output of the first command and the entrypoint logs from the restart. |
|
@copilot I tried to start from scratch but the database sticks around so now I get this: |
... The PostgreSQL volume persisted because # Stop all containers
docker compose --profile development down
# Remove the named volume explicitly
docker volume rm treebase_postgres-data
# Or remove all unused volumes
docker volume prune -f
# Verify volumes are gone
docker volume ls | grep treebase
# Now start fresh
docker compose --profile development up --buildAlternatively, if you want to keep iterating without rebuilding the database each time, you can skip the schema re-initialization by removing and recreating only the web container: # Just restart the web container (keeps database intact)
docker compose restart web-dev
docker compose logs -f web-devThis is useful once the database is properly initialized and you're just troubleshooting the application startup. |
|
@copilot it still happens. Are we sure there isn't a mistake in the SQL? |
Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
... Good catch! Fixed in commit 800e2af. The SQL schema file had a duplicate CREATE INDEX statement on lines 2527 and 2529 - the same index was being created twice: CREATE INDEX matrixelement_discretecharstate_id_idx ON matrixelement(discretecharstate_id);Removed the duplicate line. Now the database initialization should complete successfully without errors. |
|
@copilot ok, we're back to |
Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
Fixed in commit 466733f. The volumes were 0 Bytes because of a mount conflict. The Problem: The Solution:
After pulling this commit, remove the old volumes and restart: docker compose --profile development down
docker volume rm treebase_web-inf-classes treebase_web-inf-lib
docker compose --profile development up --buildThe volumes should now populate with compiled classes and JAR files. |

Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.