forked from envault/envault
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (40 loc) · 1.68 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
# composer container image version
ARG COMPOSER_VERSION=2.1.5
# php container image version
ARG PHP_VERSION=8.0-apache
################################################################################
# Stage 1: composer
################################################################################
FROM composer:${COMPOSER_VERSION} AS composer
ARG ENVAULT_VERSION=v2.5.1
# Download envault from GitHub & extract it
RUN curl -L https://github.com/envault/envault/archive/$ENVAULT_VERSION.tar.gz -o- -s \
| tar -xvzf- --strip 1
RUN composer install
################################################################################
# Stage 2: production container
################################################################################
FROM php:${PHP_VERSION}
# Add custom entrypoint
ADD docker-envault-entrypoint.sh /usr/local/bin/docker-envault-entrypoint
RUN chmod +x /usr/local/bin/docker-envault-entrypoint
ENTRYPOINT [ "/usr/local/bin/docker-envault-entrypoint" ]
CMD apache2-foreground
# Install dependencies
RUN apt-get update \
&& apt-get install -y default-mysql-client \
&& rm -rf /var/lib/apt/lists/*
# Install & activate extensions required by Laravel
RUN docker-php-ext-install mysqli pdo pdo_mysql
# Enable Apache rewrite module
RUN ln -s ../mods-available/rewrite.load /etc/apache2/mods-enabled
# Patch Apache config
ADD apache2.conf /etc/apache2/apache2.conf
# Patch Apache default site config
ADD 000-default.conf /etc/apache2/sites-available/000-default.conf
# Set workdir
WORKDIR /var/www/envault/
# Copy source files & dependencies from the composer stage
COPY --from=composer /app .
# Fix permissions of writable directories
RUN chown -R www-data:www-data storage bootstrap/cache