Skip to content

Commit 6220600

Browse files
committed
dockerised app!! Now to get gitpod working
1 parent 6abe7af commit 6220600

6 files changed

+14
-18
lines changed

.gitpod.yml

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
image: continuumio/miniconda3
1+
image:
2+
file: .gitpod.Dockerfile
23

34
ports:
45
- port: 5000
56
onOpen: open-preview
67

7-
tasks:
8-
- before: |
9-
export FLASK_APP=app
10-
export FLASK_ENV=development
11-
init: |
12-
conda create --file environment.yaml
13-
command: |
14-
flask run
15-
168
vscode:
179
extensions:
1810
- ms-python.python

Dockerfile

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11

22
FROM continuumio/miniconda3
33

4-
COPY /app .
4+
COPY . .
55

66
#---------------- Prepare the envirennment
7-
RUN conda update --name base conda &&\
8-
conda env create --file environment.yaml
9-
SHELL ["conda", "run", "--name", "flask", "/bin/bash", "-c"]
7+
RUN conda env update --name base --file environment.yaml --prune
108

119
EXPOSE 5000
1210

13-
ENTRYPOINT ["conda", "run", "--name", "flask", "python", "app.py"]
11+
ENTRYPOINT ["python", "app.py"]
12+
# ENTRYPOINT ["flask", "run"]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Export conda environment:
22
conda env export --no-builds | grep -v "^prefix: " > environment.yaml
33

44
Create conda environment:
5-
conda env create --file environment.yaml
5+
conda env create --name flask --file environment.yaml
66

77
Update conda environment:
88
conda env update --name flask --file environment.yaml --prune

app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ def hello(name=None):
1212
return render_template('hello.html', name=name)
1313

1414
if __name__ == "__main__":
15-
app.run(debug=True)
15+
app.run(host='0.0.0.0', debug=True)

docker-compose.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: "3"
2+
services:
3+
app:
4+
build: .
5+
ports:
6+
- "5000:5000"

environment.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
name: flask
21
channels:
32
- anaconda
43
- defaults

0 commit comments

Comments
 (0)