ABV / Dockerfile
rkihacker's picture
Update Dockerfile
7639b1d verified
FROM ubuntu:20.04
# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install essential dependencies for the web server and buildozer
RUN apt-get update && \
apt-get install -y \
git \
zip \
unzip \
openjdk-17-jdk \
python3.8 \
python3.8-dev \
python3.8-venv \
python3-pip \
libffi-dev \
build-essential \
autoconf \
autotools-dev \
libltdl-dev \
libtool \
ccache \
&& apt-get clean
# Set Python 3.8 as the default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
# Create a working directory
WORKDIR /app
# Create the 'uploads' directory and set permissions
# This is the line that fixes the permission error
RUN mkdir -p /app/uploads && chmod -R 777 /app/uploads
# Copy the web application files
COPY . .
# Install Python dependencies for the web app
RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt
RUN pip3 install buildozer
# Expose the port the app runs on
EXPOSE 5000
# Run the web application
CMD ["python3", "main.py"]