DeathDaDev commited on
Commit
f780aa2
1 Parent(s): 3ccfba8

feat: install Flask and set up entry point in Docker container

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -3
  2. docker-compose.yml +3 -1
Dockerfile CHANGED
@@ -8,8 +8,10 @@ RUN apt-get update && \
8
  python3-pip && \
9
  rm -rf /var/lib/apt/lists/*
10
 
11
- # Install Flask
12
- RUN pip3 install flask
 
 
13
 
14
  # Create a non-root user 'user' with UID 1000
15
  RUN useradd -m -u 1000 user
@@ -36,4 +38,4 @@ USER user
36
  EXPOSE 11434 5000
37
 
38
  # Command to run the Flask application
39
- CMD ["flask", "run", "--host=0.0.0.0", "--port=5000"]
 
8
  python3-pip && \
9
  rm -rf /var/lib/apt/lists/*
10
 
11
+ # Install Flask and set up the entry point
12
+ RUN pip3 install flask && \
13
+ echo "flask run --host=0.0.0.0 --port=5000" > /home/user/app/start.sh && \
14
+ chmod +x /home/user/app/start.sh
15
 
16
  # Create a non-root user 'user' with UID 1000
17
  RUN useradd -m -u 1000 user
 
38
  EXPOSE 11434 5000
39
 
40
  # Command to run the Flask application
41
+ CMD ["/home/user/app/start.sh"]
docker-compose.yml CHANGED
@@ -1,7 +1,9 @@
1
  version: "3.9"
2
  services:
3
  ollama:
4
- build: .
 
 
5
  ports:
6
  - "11434:11434"
7
  volumes:
 
1
  version: "3.9"
2
  services:
3
  ollama:
4
+ build:
5
+ context: .
6
+ dockerfile: Dockerfile
7
  ports:
8
  - "11434:11434"
9
  volumes: