This repository was archived by the owner on Apr 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (36 loc) · 1.63 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (36 loc) · 1.63 KB
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
# Canvas2 Dockerfile
# By: Andrew Augustine
FROM python:3
LABEL org.opencontainers.image.authors="me@azureagst.dev"
LABEL org.opencontainers.image.source="https://github.com/azure-agst/canvas2"
# Set our image's working directory
# =============================================================================
# Essentially, this sets PWD for the following commands
WORKDIR /usr/src/app
# Copy in the requirements file first, then install them.
# =============================================================================
# This is done seperately from the rest of the files for a reason! Docker's
# Getting Started tutorial explains this well, specifically the "Image Building
# Best Practices" section.
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy in the rest of our app to the image
# =============================================================================
COPY . .
# Download NLTK files
# =============================================================================
RUN python3 -m nltk.downloader stopwords brown omw-1.4 wordnet punkt
# Expose ports
# =============================================================================
EXPOSE 5000/tcp
# Set static env vars
# =============================================================================
ENV DOCKER_ENV=True
ENV FLASK_APP=canvas2
ENV FLASK_ENV=production
# Set the command to run the actual project
# =============================================================================
# - Entrypoint is the default command, non-negotiable
# - CMD are args appended that can be overridden at runtime
ENTRYPOINT [ "flask", "run" ]
CMD [ "--host", "0.0.0.0" ]