sghorbal commited on
Commit
68b3cf9
·
1 Parent(s): 4aafeb1

adapt Dockerfile to run the tests

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -2
Dockerfile CHANGED
@@ -13,14 +13,23 @@ RUN pip install --upgrade pip && \
13
  pip install --no-cache-dir -r requirements-dev.txt; \
14
  fi
15
 
16
- # Installer curl pour le healthcheck
17
- RUN apt-get update && apt-get install -y --no-install-recommends curl && \
 
 
 
 
 
 
 
18
  rm -rf /var/lib/apt/lists/*
19
 
20
  # Copier le code
21
  COPY ./entrypoint.sh /tmp/entrypoint.sh
22
  COPY ./src /app/src
23
  COPY ./tests /app/tests
 
 
24
 
25
  WORKDIR /app
26
 
@@ -36,6 +45,10 @@ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
36
 
37
  # Utilisateur non-root pour la sécurité
38
  RUN useradd --create-home appuser
 
 
 
 
39
  USER appuser
40
 
41
  # Entrypoint (par exemple pour lancer uvicorn)
 
13
  pip install --no-cache-dir -r requirements-dev.txt; \
14
  fi
15
 
16
+ RUN apt-get update && \
17
+ apt-get install -y --no-install-recommends \
18
+ curl \
19
+ libpq-dev \
20
+ postgresql \
21
+ postgresql-contrib \
22
+ gcc \
23
+ g++ \
24
+ make && \
25
  rm -rf /var/lib/apt/lists/*
26
 
27
  # Copier le code
28
  COPY ./entrypoint.sh /tmp/entrypoint.sh
29
  COPY ./src /app/src
30
  COPY ./tests /app/tests
31
+ COPY ./pytest.ini /app/pytest.ini
32
+ COPY ./.env.test /app/.env.test
33
 
34
  WORKDIR /app
35
 
 
45
 
46
  # Utilisateur non-root pour la sécurité
47
  RUN useradd --create-home appuser
48
+
49
+ # Give permissions to the appuser
50
+ RUN chown -R appuser:appuser /app
51
+
52
  USER appuser
53
 
54
  # Entrypoint (par exemple pour lancer uvicorn)