ABDAN HAFIDZ commited on
Commit
a070025
·
unverified ·
1 Parent(s): a29d91f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -66
Dockerfile CHANGED
@@ -1,68 +1,5 @@
1
- FROM php:8.4-cli
2
 
3
- ARG VITE_APP_NAME=Laravel
4
- ARG RAG_API_BASE_URL=https://lifedebugger-raghub-sevima-test.hf.space/api/v1
5
- ARG VITE_RAG_API_BASE_URL=https://lifedebugger-raghub-sevima-test.hf.space/api/v1
6
 
7
- ENV APP_NAME="${VITE_APP_NAME}" \
8
- APP_ENV=production \
9
- APP_DEBUG=false \
10
- APP_URL=http://localhost \
11
- LOG_CHANNEL=stderr \
12
- LOG_LEVEL=debug \
13
- SESSION_DRIVER=file \
14
- CACHE_STORE=file \
15
- QUEUE_CONNECTION=sync \
16
- DB_CONNECTION=sqlite \
17
- PORT=7860 \
18
- RAG_API_BASE_URL="${RAG_API_BASE_URL}" \
19
- VITE_RAG_API_BASE_URL="${VITE_RAG_API_BASE_URL}" \
20
- VITE_APP_NAME="${VITE_APP_NAME}"
21
-
22
- RUN apt-get update && apt-get install -y \
23
- git unzip curl zip ca-certificates gnupg \
24
- libzip-dev \
25
- libpng-dev \
26
- libjpeg-dev \
27
- libfreetype6-dev \
28
- libonig-dev \
29
- libxml2-dev \
30
- libsqlite3-dev \
31
- && docker-php-ext-install \
32
- zip \
33
- pdo \
34
- pdo_mysql \
35
- pdo_sqlite \
36
- mbstring \
37
- exif \
38
- pcntl \
39
- bcmath \
40
- gd \
41
- && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
42
- && apt-get install -y nodejs \
43
- && rm -rf /var/lib/apt/lists/*
44
-
45
- COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
46
-
47
- RUN useradd -m -u 1000 user
48
-
49
- ENV HOME=/home/user
50
- RUN mkdir -p /home/user/app && chown user:user /home/user/app
51
- WORKDIR /home/user/app
52
-
53
- COPY --chown=user:user . .
54
-
55
- USER user
56
-
57
- RUN composer install --no-dev --optimize-autoloader --no-interaction --no-scripts \
58
- && php artisan package:discover --ansi \
59
- && php artisan config:clear \
60
- && php artisan route:clear \
61
- && npm ci \
62
- && npm run build \
63
- && rm -rf node_modules \
64
- && php artisan view:clear
65
-
66
- EXPOSE 7860
67
-
68
- CMD ["sh", "-c", "if [ -n \"$SPACE_HOST\" ] && [ \"$APP_URL\" = \"http://localhost\" ]; then export APP_URL=\"https://$SPACE_HOST\"; fi; if [ -n \"$SPACE_HOST\" ] && [ -z \"$ASSET_URL\" ]; then export ASSET_URL=\"https://$SPACE_HOST\"; fi; if [ -z \"$APP_KEY\" ]; then export APP_KEY=$(php artisan key:generate --show --no-interaction); fi; php artisan serve --host=0.0.0.0 --port=${PORT:-7860}"]
 
1
+ COPY docker/entrypoint.sh /entrypoint.sh
2
 
3
+ RUN chmod +x /entrypoint.sh
 
 
4
 
5
+ ENTRYPOINT ["/entrypoint.sh"]