-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (40 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
49 lines (40 loc) · 1.17 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
45
46
47
48
49
# DESCRIPTION: Create Flask-Portfolio in Container
# AUTHOR: Dhrumil Mistry <contact@dmdhrumilmistry.me>
# COMMENTS:
# This file describes how to build Portfolio Website
# in a container with all dependencies installed.
# USAGE:
# # Download flask-portfolio Dockerfile
# wget [link]
#
# # Build image
# docker build -t flask-portfolio .
#
# # run docker container
# docker run -d flask-portfolio
#
FROM ubuntu
LABEL maintainer "Dhrumil Mistry <contact@dmdhrumilmistry.me>"
# install requirements
RUN apt update -y && apt install python3 python3-pip -y
# configure working directory
WORKDIR /python-docker
# copy files
COPY static /python-docker/static
COPY templates /python-docker/templates
COPY app.py /python-docker/app.py
COPY requirements.txt /python-docker/requirements.txt
COPY wsgi.py /python-docker/wsgi.py
COPY README.md /python-docker/README.md
COPY LICENSE /python-docker/LICENSE
# install project requirements
RUN pip3 install -r requirements.txt
# expose docker port to host machine
EXPOSE 8080
# migrate db
RUN rm -rf migrations
RUN flask db init
RUN flask db migrate -m "initial migration"
RUN flask db upgrade
# start project
CMD [ "waitress-serve", "wsgi:app" ]