├── nginx-server └── nginx.Dockerfile ├── java ├── java-app.Dockerfile └── priyanshu-spring-app │ ├── priyanshu-spring-app.Dockerfile │ └── sql-docker-compose.yml ├── node └── node-app.Dockerfile ├── python-streamlit └── streamlit.Dockerfile ├── python-flask └── flask-app.Dockerfile └── python-django └── django-todo-app.Dockerfile /nginx-server/nginx.Dockerfile: -------------------------------------------------------------------------------- 1 | # Use an official web server image (e.g., Nginx) as a parent image 2 | FROM nginx:latest 3 | 4 | # Set the working directory to /usr/share/nginx/html 5 | WORKDIR /usr/share/nginx/html 6 | 7 | # Copy the content of the local src directory to the working directory 8 | COPY . . 9 | 10 | # Expose port 80 to the outside world 11 | EXPOSE 80 -------------------------------------------------------------------------------- /java/java-app.Dockerfile: -------------------------------------------------------------------------------- 1 | # Use an official OpenJDK runtime as a parent image 2 | FROM openjdk:11-jre-slim 3 | 4 | # Set the working directory to /app 5 | WORKDIR /app 6 | 7 | # Copy the current directory contents into the container at /app 8 | COPY . . 9 | 10 | # Compile the Java application 11 | RUN javac HelloWorld.java 12 | 13 | # Make port 8080 available to the world outside this container 14 | EXPOSE 8080 15 | 16 | # Run the Java application 17 | CMD ["java", "HelloWorld"] -------------------------------------------------------------------------------- /java/priyanshu-spring-app/priyanshu-spring-app.Dockerfile: -------------------------------------------------------------------------------- 1 | # Use a base image with Java and Maven 2 | FROM maven:3.8-openjdk-11 AS build 3 | WORKDIR /app 4 | 5 | # Copy the project files and build the application 6 | COPY . . 7 | RUN mvn build package 8 | 9 | # Create a minimal runtime image 10 | FROM openjdk:8-jre-slim 11 | WORKDIR /app 12 | COPY --from=build /app/target/your-application.jar . 13 | 14 | # Expose the port that the application listens on 15 | EXPOSE 8080 16 | 17 | # Set the entry point 18 | CMD ["java", "-jar", "spring-app.jar"] 19 | 20 | #docker run -p 8080:8080 spring-app-img -------------------------------------------------------------------------------- /java/priyanshu-spring-app/sql-docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | mysql: 4 | image: mysql:latest 5 | environment: 6 | MYSQL_ROOT_PASSWORD: 7 | MYSQL_DATABASE: 8 | MYSQL_USER: 9 | MYSQL_PASSWORD: 10 | 11 | spring-app: 12 | image: your-application-image:latest 13 | depends_on: 14 | - mysql 15 | ports: 16 | - "8081:8081" 17 | environment: 18 | SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/your-database-name 19 | SPRING_DATASOURCE_USERNAME: 20 | SPRING_DATASOURCE_PASSWORD: 21 | -------------------------------------------------------------------------------- /node/node-app.Dockerfile: -------------------------------------------------------------------------------- 1 | # Use an official Node.js runtime as a parent image 2 | FROM node:14-alpine 3 | 4 | # Set the working directory to /app 5 | WORKDIR /app 6 | 7 | # Copy package.json and package-lock.json to the working directory 8 | COPY package*.json ./ 9 | 10 | # Install app dependencies 11 | RUN npm install 12 | 13 | # Copy the current directory contents into the container at /app 14 | COPY . . 15 | 16 | # Make port 3000 available to the world outside this container 17 | EXPOSE 3000 18 | 19 | # Define environment variable 20 | ENV NODE_ENV=production 21 | 22 | # Run the app 23 | CMD ["node", "app.js"] -------------------------------------------------------------------------------- /python-streamlit/streamlit.Dockerfile: -------------------------------------------------------------------------------- 1 | # Use an official Python runtime as a parent image 2 | FROM python:3.8-slim 3 | 4 | # Set the working directory to /app 5 | WORKDIR /app 6 | 7 | # Copy the current directory contents into the container at /app 8 | COPY . /app 9 | 10 | # Install any needed packages specified in requirements.txt 11 | RUN pip install --no-cache-dir -r requirements.txt 12 | 13 | # Make port 8501 available to the world outside this container 14 | EXPOSE 8501 15 | 16 | # Define environment variable 17 | ENV NAME World 18 | 19 | # Run app.py when the container launches 20 | CMD ["streamlit", "run", "app.py"] 21 | -------------------------------------------------------------------------------- /python-flask/flask-app.Dockerfile: -------------------------------------------------------------------------------- 1 | # Use an official Python runtime as a parent image 2 | FROM python:3.8-slim 3 | 4 | # Set the working directory to /app 5 | WORKDIR /app 6 | 7 | # Copy the current directory contents into the container at /app 8 | COPY . /app 9 | 10 | # Install any needed packages specified in requirements.txt 11 | RUN pip install --no-cache-dir -r requirements.txt 12 | 13 | # Make port 5000 available to the world outside this container 14 | EXPOSE 5000 15 | 16 | # Define environment variable 17 | ENV FLASK_APP=app.py 18 | 19 | # Run app.py when the container launches 20 | CMD ["flask", "run", "--host=0.0.0.0"] 21 | -------------------------------------------------------------------------------- /python-django/django-todo-app.Dockerfile: -------------------------------------------------------------------------------- 1 | # Start with a Python 3.9 image 2 | FROM python 3 | 4 | # Set the working directory to /app 5 | WORKDIR /todoApp 6 | 7 | # Copy the requirements.txt file into the container 8 | COPY requirement.txt . 9 | 10 | # Install the required packages 11 | RUN pip3 install -r requirement.txt 12 | 13 | # Copy the rest of the application code into the container 14 | COPY . . 15 | 16 | # Expose port 8000 for the Django application 17 | EXPOSE 8000 18 | 19 | # Collect static files 20 | RUN python manage.py 21 | 22 | # Run Django's migrate command to create the database schema 23 | RUN python manage.py migrate 24 | 25 | # Start the Django development server 26 | CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] --------------------------------------------------------------------------------