File size: 938 Bytes
894cea6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0175c10
ac476a6
0175c10
 
894cea6
 
 
9664235
 
894cea6
9664235
f448e58
 
894cea6
9664235
 
 
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
# Use an official Python runtime as a parent image
FROM python:3.11-slim

# Install any system dependencies (for example, gcc may be needed for some Python packages)
RUN apt-get update && apt-get install -y gcc

# Set the working directory to /app
WORKDIR /app

# Copy the requirements file into the container at /app
COPY requirements.txt .

# Upgrade pip and install any needed packages specified in requirements.txt
RUN pip install --upgrade pip && pip install -r requirements.txt

# Create cache directory and set permissions
RUN mkdir -p /app/cache /app/uploads /app/data && chmod -R 777 /app/cache /app/uploads /app/data
RUN chmod -R 777 /app

# Copy the rest of the application code into the container
COPY . .

# Run the application
COPY . /app/

ENV FLASK_APP=app.py \
    FLASK_ENV=production\
    DATABASE_URI=sqlite:///employee.db

EXPOSE 7860

CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:7860", "--timeout", "120", "app:app"]