Skip to content

Commit e773319

Browse files
authored
Merge pull request #26 from devfile-samples/generalize-python-1
Generalize Python Application
2 parents 2dbe88e + 83e9cbc commit e773319

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

docker/Dockerfile

+9-7
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ ENV FLASK_PORT=8081
77
# Set the working directory in the container
88
WORKDIR /projects
99

10-
# Copy the dependencies file to the working directory
11-
COPY requirements.txt .
12-
13-
# Install any dependencies
14-
RUN pip install -r requirements.txt
15-
1610
# Copy the content of the local src directory to the working directory
1711
COPY . .
1812

13+
# Install any dependencies
14+
RUN \
15+
if [ -f requirements.txt ]; \
16+
then pip install -r requirements.txt; \
17+
elif [ `ls -1q *.txt | wc -l` == 1 ]; \
18+
then pip install -r *.txt; \
19+
fi
20+
1921
# Specify the command to run on container start
20-
CMD [ "python", "./app.py" ]
22+
CMD [ "python", "./app.py" ]

0 commit comments

Comments
 (0)