File size: 1,069 Bytes
055f019 7639b1d 055f019 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
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"] |