Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 1.44 KB

File metadata and controls

53 lines (42 loc) · 1.44 KB

Docker Setup Instructions

Prerequisites

  • Docker installed on your computer
  • Docker Compose (usually comes with Docker Desktop)

Building and Running

Option 1: Using Docker Compose (Recommended)

# 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

Option 2: Using Docker directly

# 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

How It Works

  • 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

Modifying the Code

After making changes to the Java source code, rebuild the image:

docker-compose up --build

Troubleshooting

  • 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