Browse Source

Add a Docker environment

Ian Adam Naval 2 years ago
parent
commit
3aea6dd8e7
2 changed files with 32 additions and 0 deletions
  1. 22
    0
      Dockerfile
  2. 10
    0
      Makefile

+ 22
- 0
Dockerfile View File

@@ -0,0 +1,22 @@
1
+FROM python:3.7.2
2
+
3
+EXPOSE 5000
4
+VOLUME /app
5
+
6
+RUN pip install pipenv
7
+
8
+WORKDIR /app
9
+
10
+ADD Pipfile .
11
+ADD Pipfile.lock .
12
+RUN pipenv install --system --deploy --ignore-pipfile --verbose
13
+
14
+ENV AUTOPILOT_USERNAME ""
15
+ENV AUTOPILOT_PASSWORD ""
16
+ENV AUTOPILOT_USER_ID -1
17
+
18
+ADD ./autopilot /app/autopilot
19
+
20
+CMD ["uwsgi", "--http", "0.0.0.0:5000", \
21
+              "--protocol", "uwsgi", \
22
+              "--wsgi", "autopilot.app:app"]

+ 10
- 0
Makefile View File

@@ -0,0 +1,10 @@
1
+default: run 
2
+
3
+run: build
4
+	docker run -v $(CURDIR):/app -p "5000:5000" --env-file=.env ianonavy/autopilot
5
+
6
+build: Dockerfile
7
+	docker build -t ianonavy/autopilot .
8
+
9
+release:
10
+	docker push ianonavy/autopilot:latest

Loading…
Cancel
Save