-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 759 Bytes
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 759 Bytes
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
# Dockerfile
# Builder stage
FROM public.ecr.aws/composer/composer:2 AS builder
WORKDIR /app
COPY . .
RUN composer install --no-dev --no-interaction --optimize-autoloader
# Production stage
FROM public.ecr.aws/php/php:8.2-fpm-alpine
WORKDIR /var/www
# Install dependencies
RUN apk add --no-cache nginx libpq
# Copy nginx configuration
COPY docker/production/nginx/nginx.conf /etc/nginx/nginx.conf
# Copy application files from builder stage
COPY --from=builder /app .
# Copy start script
COPY docker/production/start.sh /usr/local/bin/start.sh
RUN chmod +x /usr/local/bin/start.sh
# Set permissions
RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache
# Expose port 80
EXPOSE 80
# Start supervisord
CMD ["/usr/local/bin/start.sh"]