-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (30 loc) · 945 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Use the bitnami/laravel as a base image
FROM bitnami/laravel:11.6.1
# Set working directory
WORKDIR /app
# Copy Laravel code to container
COPY ./ /app
# Install dependencies via Composer
RUN composer install --no-dev --optimize-autoloader
# Provide .env file (if you have one locally to copy)
RUN touch .env
RUN echo "APP_KEY=" > .env
# Generate the Laravel app key
RUN php artisan key:generate
# Ensure DB is available
RUN mkdir -p database/db
RUN touch database/db/database.sqlite
# Expose the web port (aligning with the Bitnami Dockerfile)
EXPOSE 3000
# Set default values
ENV APP_ENV=production
ENV APP_DEBUG=false
ENV APP_TIMEZONE=UTC
ENV APP_URL=
ENV LOG_LEVEL=debug
ENV DB_CONNECTION=sqlite
ENV DB_DATABASE=database/db/database.sqlite
# Make public assets available to web requests
RUN php artisan storage:link
# Set the command to run the Laravel application
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=3000"]