lucianotonet commited on
Commit
0e0137f
·
1 Parent(s): 6b5b1be

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -3
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM php:8.1-fpm
2
 
3
  RUN apt-get update && apt-get install -y \
4
  libonig-dev \
@@ -9,18 +9,42 @@ RUN apt-get update && apt-get install -y \
9
  git \
10
  curl
11
 
 
 
 
 
12
  WORKDIR /app
13
 
14
- RUN --mount=type=secret,id=GITHUB_PAT \
15
- git clone https://lucianotonet:$(cat /run/secrets/GITHUB_PAT)@github.com/agenciamav/app.agenciamav.com.br.git .
16
 
 
 
 
 
 
 
 
 
17
  COPY . /app
18
 
 
 
 
19
  RUN php artisan storage:link && \
20
  php artisan config:cache && \
21
  php artisan route:cache && \
22
  php artisan view:cache
23
 
 
 
 
 
 
24
  EXPOSE 7860
25
 
 
 
 
 
26
  CMD ["/start.sh"]
 
1
+ FROM php:8.2-fpm
2
 
3
  RUN apt-get update && apt-get install -y \
4
  libonig-dev \
 
9
  git \
10
  curl
11
 
12
+ RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
13
+
14
+ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
15
+
16
  WORKDIR /app
17
 
18
+ ARG CACHEBUST=1
19
+ RUN echo "Cache bust: $CACHEBUST" > /dev/null
20
 
21
+ ARG APP_ENV
22
+
23
+ RUN --mount=type=secret,id=GITHUB_PAT \
24
+ if [ "$APP_ENV" != "local" ] ; then \
25
+ rm -rf /app/* /app/.* || true && \
26
+ git clone https://lucianotonet:$(cat /run/secrets/GITHUB_PAT)@github.com/agenciamav/app.agenciamav.com.br.git . ; \
27
+ fi
28
+
29
  COPY . /app
30
 
31
+ RUN --mount=type=secret,id=OPENAI_API_KEY \
32
+ composer install
33
+
34
  RUN php artisan storage:link && \
35
  php artisan config:cache && \
36
  php artisan route:cache && \
37
  php artisan view:cache
38
 
39
+ RUN chown -R www-data:www-data /app/storage && \
40
+ chmod -R 775 /app/storage && \
41
+ chown -R www-data:www-data /app/bootstrap/cache && \
42
+ chmod -R 775 /app/bootstrap/cache
43
+
44
  EXPOSE 7860
45
 
46
+ COPY start.sh /start.sh
47
+
48
+ RUN chmod +x /start.sh
49
+
50
  CMD ["/start.sh"]