- Docker installed on your computer
- Docker Compose (usually comes with Docker Desktop)
# Build and run the application
docker-compose up
# To rebuild after code changes
docker-compose up --build
# To run in detached mode
docker-compose up -d
# To stop the container
docker-compose down# Build the Docker image
docker build -t acms .
# Run the container
docker run --rm \
-v "$(pwd)/input.txt:/app/input.txt" \
-v "$(pwd)/output.txt:/app/output.txt" \
-v "$(pwd)/student.txt:/app/student.txt" \
-v "$(pwd)/courseEnrollment.txt:/app/courseEnrollment.txt" \
acms- The Dockerfile compiles all Java files in the
src/directory - Text files (input.txt, output.txt, student.txt, courseEnrollment.txt) are mounted as volumes
- This allows the application to read/write data files on your host machine
- Any changes to output files will be reflected on your computer
After making changes to the Java source code, rebuild the image:
docker-compose up --build- If you get permission errors, ensure the text files are readable/writable
- If the container exits immediately, check the logs:
docker-compose logs - To run the container interactively for debugging:
docker run -it --rm ogrenciye-gelir-app /bin/bash