-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
57 lines (45 loc) · 1.34 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
52
53
54
55
56
57
# -----------------
# NPM build
# -----------------
FROM node:8.16.1 as npm
WORKDIR /app
RUN mkdir -p /app/public/js
COPY ./package.json ./webpack.mix ./package-lock.json /app/
COPY ./resources/js/ /app/resources/js/
COPY ./resources/css/ /app/resources/css/
RUN npm i
RUN npm run production
# -----------------
# App build
# -----------------
FROM php:7.3.9-apache
LABEL maintainer "Alexander LP xy2z <[email protected]>"
# Packages
RUN apt update && apt install -y netcat
# Apache
COPY ./docker/apache.conf /etc/apache2/sites-available/000-default.conf
RUN a2enmod rewrite
# PHP Extensions
RUN apt-get update && \
apt-get install -y --no-install-recommends git zip unzip libzip-dev
RUN docker-php-ext-configure zip --with-libzip
RUN docker-php-ext-install pdo_mysql zip
RUN docker-php-ext-enable pdo_mysql zip
# Add app
COPY . /app
WORKDIR /app
# Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN composer install --no-plugins --no-scripts
# Copy files from npm
COPY --from=npm /app/public/js /app/public/js
COPY --from=npm /app/public/css /app/public/css
# Entrypoint
# RUN chmod +x /app/docker/entrypoint.sh
ENTRYPOINT ["/app/docker/entrypoint.sh"]
CMD ["apache2-foreground"]
# Clean up to decrease image size
RUN apt-get update && \
apt-get purge -y curl ca-certificates && \
apt-get autoremove -y && \
apt-get clean