forked from sjbylo/flask-vote-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (25 loc) · 958 Bytes
/
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
# Using plain centos base image, add pip to it
FROM centos:7
LABEL Version 1.0
MAINTAINER Stephen Bylo <[email protected]>
# Set the application directory
WORKDIR /app
# Install python and pip
#RUN yum -y update && yum -y install epel-release && yum -y install python-pip && yum -y clean all
RUN yum -y install epel-release && yum -y install python-pip && yum -y clean all
# Install MySQL-python (app dependencies)
RUN yum -y install MySQL-python && yum -y clean all
# Install requirements.txt
ADD requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
# Copy code from the current folder to /app inside the container
ADD . /app
# Remove any existing db data
RUN rm -f /app/data/app.db
# Expose the port server listen to
EXPOSE 8080
# Ensure this runs as any non-root user (for OpenShift)
RUN chmod -R 777 /app
USER 1001
# Define command to be run when launching the container
CMD ["python", "app.py"]