-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
48 lines (36 loc) · 1.11 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
FROM node:14 AS build
ARG NODE_ENV
WORKDIR /build
COPY ./ /build
RUN npm install
RUN npm install typescript
RUN npm run build-${NODE_ENV}
FROM php:apache
ARG NODE_ENV
ENV COMPOSER_ALLOW_SUPERUSER=1
EXPOSE 80
WORKDIR /var/www/html/
RUN apt-get update -qq && \
apt-get install -qy \
git \
gnupg \
unzip \
zip && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# PHP Extensions
RUN docker-php-ext-install -j$(nproc) opcache pdo_mysql
# Apache
COPY config/${NODE_ENV}/apache2/conf-available/swag.conf /etc/apache2/conf-available/swag.conf
COPY /config/${NODE_ENV}/apache2/sites-enabled /etc/apache2/sites-enabled/
COPY --from=build /build/app/ /var/www/html/
COPY app/src/inc/${NODE_ENV}/ /var/www/html/inc/
RUN rm -rf /var/www/html/src
RUN mkdir -p /var/www/html/file/
RUN mkdir -p /var/www/html/db/
RUN chmod -R 777 /var/www/html/db/
RUN chmod -R 777 /var/www/html/file/
RUN a2enmod rewrite
RUN a2enmod remoteip && \
a2enconf swag && \
/etc/init.d/apache2 restart