Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions java-twitter-feed-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Multi-stage build for Java Twitter Feed API
# Stage 1: Build the application
FROM openjdk:8-jdk-alpine AS builder

# Install Maven
RUN apk add --no-cache maven

# Set working directory
WORKDIR /app

# Copy pom.xml first for better Docker layer caching
COPY pom.xml .

# Download dependencies
RUN mvn dependency:go-offline -B

# Copy source code
COPY src ./src

# Build the WAR file
RUN mvn clean package -DskipTests

# Stage 2: Runtime with Tomcat 8
FROM tomcat:8-jre8-alpine

# Remove default webapps
RUN rm -rf /usr/local/tomcat/webapps/*

# Copy the WAR file from builder stage
COPY --from=builder /app/target/simple-service-webapp.war /usr/local/tomcat/webapps/ROOT.war

# Set environment variables for Twitter OAuth credentials
ENV TWITTER_CONSUMER_KEY=""
ENV TWITTER_CONSUMER_SERVICE=""
ENV TWITTER_OAUTH_ACCESS_TOKEN=""
ENV TWITTER_OAUTH_ACCESS_TOKEN_SECRET=""

# Expose port 8080
EXPOSE 8080

# Start Tomcat
CMD ["catalina.sh", "run"]

33 changes: 33 additions & 0 deletions nodejs-users-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Use Node.js 14 base image
FROM node:14-alpine

# Set working directory
WORKDIR /app

# Copy package.json first for better Docker layer caching
COPY package.json ./

# Install dependencies
RUN npm install

# Copy source code
COPY server.js ./
COPY config.js ./
COPY test.js ./
COPY app/ ./app/

# Expose port 8080
EXPOSE 8080

# Set environment variables for MongoDB connection
ENV MONGODB_USER=""
ENV MONGODB_PASSWORD=""
ENV MONGODB_DATABASE=""
ENV DATABASE_SERVICE_NAME=""

# Set environment variable for email service connection
ENV EMAIL_APPLICATION_DOMAIN=""

# Start application with node server.js
CMD ["node", "server.js"]

28 changes: 28 additions & 0 deletions php-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use PHP 7.4 with Apache base image
FROM php:7.4-apache

# Set working directory
WORKDIR /var/www/html

# Copy all PHP files and static assets
COPY index.php .
COPY login.php .
COPY register.php .
COPY friends.php .
COPY profile.php .
COPY tweets.php .
COPY hack.php .
COPY head.php .
COPY style.css .
COPY script.js .

# Set environment variables for backend service URLs
ENV USER_REG_SVC=""
ENV TWITTER_FEED_SVC=""

# Expose port 80 (Apache default)
EXPOSE 80

# Apache is already configured to serve PHP files in the base image
# The default CMD starts Apache in the foreground

33 changes: 33 additions & 0 deletions python-email-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Use Python 3.8 base image
FROM python:3.8-alpine

# Set working directory
WORKDIR /app

# Copy requirements.txt first for better Docker layer caching
COPY requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy source code
COPY sample.py .
COPY setup.py .

# Set environment variables for Gmail SMTP
ENV GMAIL_USERNAME=""
ENV GMAIL_PASSWORD=""

# Set environment variables for MySQL connection
ENV MYSQL_USER=""
ENV MYSQL_PASSWORD=""
ENV MYSQL_SERVICE_HOST=""
ENV MYSQL_DATABASE=""

# Expose port 8080
EXPOSE 8080

# Start application with gunicorn WSGI server
# The WSGI application is defined as 'api' in sample.py
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "sample:api"]