-
Notifications
You must be signed in to change notification settings - Fork 46
/
Dockerfile
49 lines (39 loc) · 1.27 KB
/
Dockerfile
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
49
# Use an official Python runtime as the parent image
FROM python:3.8-slim
# Set environment variables
# Prevents Python from writing pyc files to disc
ENV PYTHONDONTWRITEBYTECODE 1
# Prevents Python from buffering stdout and stderr
ENV PYTHONUNBUFFERED 1
# Create and set the working directory
WORKDIR /app
# Install dependencies
RUN apt-get update && \
apt-get install -y libcurl4-openssl-dev curl && \
apt-get install -y git && \
curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh && \
bash nodesource_setup.sh && \
apt-get install -y nodejs && \
node -v && \
find /var/*/apt -type f -delete
RUN pip install --no-cache-dir Flask-SQLAlchemy \
SQLAlchemy \
beautifulsoup4 \
nltk \
markdown \
Flask-Assets \
google-api-python-client \
gunicorn \
Pillow \
Flask-Compress
RUN npm install -g sass
# Copy the current directory contents into the container at /app
COPY . /app/
# Create database
RUN python3 content_to_db.py
# Download nltk package
RUN python3 -c "import nltk; nltk.download('stopwords')"
# Make port 80 available to the world outside this container
EXPOSE 8080
# Run gunicorn when the container launches
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--timeout", "240", "--workers", "2", "app:app"]