luciano commited on
Commit
94a92b2
·
1 Parent(s): eeaf32b

Add entrypoint to create /data dir before starting app

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -1
  2. entrypoint.sh +6 -0
Dockerfile CHANGED
@@ -12,6 +12,8 @@ COPY backend/requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
  COPY backend/ .
 
 
15
 
16
  ENV HOST=0.0.0.0
17
  ENV PORT=7860
@@ -22,4 +24,4 @@ ENV DATABASE_URL=sqlite:////data/nexusedu.db
22
 
23
  EXPOSE 7860
24
 
25
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
  COPY backend/ .
15
+ COPY entrypoint.sh /entrypoint.sh
16
+ RUN chmod +x /entrypoint.sh
17
 
18
  ENV HOST=0.0.0.0
19
  ENV PORT=7860
 
24
 
25
  EXPOSE 7860
26
 
27
+ CMD ["/entrypoint.sh"]
entrypoint.sh ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ mkdir -p /data
5
+
6
+ exec uvicorn main:app --host 0.0.0.0 --port 7860