-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmsg.dockerfile
More file actions
46 lines (33 loc) · 1.07 KB
/
msg.dockerfile
File metadata and controls
46 lines (33 loc) · 1.07 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
# Use the official PHP image as base image
FROM php:8.0
# Set the working directory in the container
WORKDIR /var/www/html
RUN echo "messages app"
# Install dependencies
RUN apt-get update && \
apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Copy the rest of the application code
COPY messenger .
RUN cp .env.example .env
# Copy composer.json and composer.lock
COPY messenger/composer.json messenger/composer.lock ./
# Install project dependencies
RUN composer install
# Generate autoload files
RUN composer dump-autoload
# Set permissions for Laravel
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
# Expose port 9000 and start PHP built-in server
CMD ["php", "artisan", "serve", "--host", "0.0.0.0", "--port", "9000"]
EXPOSE 9000