-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (55 loc) · 1.62 KB
/
Dockerfile
File metadata and controls
69 lines (55 loc) · 1.62 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
FROM php:8.2-fpm
# Set working directory
WORKDIR /var/www
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
locales \
zip \
jpegoptim optipng pngquant gifsicle \
vim \
unzip \
git \
curl \
libzip-dev \
libonig-dev \
python3 \
python3-pip \
python3-dev \
python3-venv \
supervisor
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/
RUN docker-php-ext-install gd
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Add user for Laravel application
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www
# Copy code to working directory
COPY --chown=www:www . /var/www
# Install PHP dependencies
RUN composer install --no-interaction --no-plugins --no-scripts
# Install Python dependencies
RUN if [ -f /var/www/agents/requirements.txt ]; then \
python3 -m venv /var/www/agents/.venv && \
/var/www/agents/.venv/bin/pip install --upgrade pip && \
/var/www/agents/.venv/bin/pip install -r /var/www/agents/requirements.txt; \
fi
# Generate Laravel key
RUN php artisan key:generate
# Set permissions
RUN chown -R www:www /var/www
RUN chmod -R 755 /var/www/storage /var/www/bootstrap/cache
# Configure Supervisor
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Expose port 9000
EXPOSE 9000
# Start PHP-FPM server
CMD ["php-fpm"]