Skip to content

Instantly share code, notes, and snippets.

@rahulgayen
Created August 28, 2023 08:47
Show Gist options
  • Select an option

  • Save rahulgayen/d2f86366b283dd3591aa4c0a4451b166 to your computer and use it in GitHub Desktop.

Select an option

Save rahulgayen/d2f86366b283dd3591aa4c0a4451b166 to your computer and use it in GitHub Desktop.
Dockerfile for java and python environment
# Start from the official Ubuntu image
FROM ubuntu:18.04 AS openjdk-builder
# Install system dependencies
RUN apt-get update && apt-get install -y \
openjdk-8-jdk \
&& rm -rf /var/lib/apt/lists/*
# Base image for Python 3.9 with OpenJDK 8
FROM python:3.9
# Set up environment variables for Java
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
ENV PATH="$JAVA_HOME/bin:${PATH}"
# Copy Java installation from the openjdk-builder stage
COPY --from=openjdk-builder $JAVA_HOME $JAVA_HOME
# Install Python dependencies
# COPY requirements.txt /app/
# RUN pip install --no-cache-dir -r requirements.txt
# Set the working directory
WORKDIR /app
# Copy your Python application code into the container
COPY . /app
RUN pip install tabula-py
# Define the command to run your Python application
CMD ["python", "app.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment