This project provides a Docker setup for deploying a Tomcat server with custom configurations.
- Docker
- Docker Compose
-
Clone this repository:
git clone https://github.com/yourusername/docker-tomcat.git cd docker-tomcat -
Change the
.envfile in the project root and set theHTTP_PORTvariable:HTTP_PORT="8080:8080" -
Build and start the container:
docker-compose up -d -
Access Tomcat at
http://localhost:8080
Dockerfile-tomcat: Defines the Tomcat server imagedocker-compose.yml: Orchestrates the Tomcat serviceconfig/context.xml: Custom context configuration for Tomcat managerconfig/tomcat-users.xml: Defines Tomcat users and roles
To deploy your web application:
- Place your WAR file in the project directory
- Uncomment and modify the following line in
docker-compose.yml:- ./yourapp.war:/usr/local/tomcat/webapps/yourapp.war
To stop and remove the containers:
docker-compose down
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
MIT License
Copyright (c) 2024 c0lap5o
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.