-
-
Notifications
You must be signed in to change notification settings - Fork 303
/
Dockerfile
49 lines (35 loc) · 1.02 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
# -------------------
# Build Stage 1 (npm)
# -------------------
FROM node:alpine AS appbuild
RUN apk add --update --no-cache p7zip
WORKDIR /usr/src/app
COPY ./package.json ./
RUN npm install
COPY . ./
RUN npm run build:prod
# RUN npm run build
# ------------------------
# Build Stage 2 (composer)
# ------------------------
FROM composer AS apibuild
WORKDIR /app
COPY ./src/api ./
RUN composer install
# --------------------------
# Build Stage 3 (php-apache)
# This build takes the production build from staging builds
# --------------------------
FROM php:7.3-apache
ENV PROJECT /var/www/html
RUN apt-get update && apt-get install -y sqlite3 php7.3-sqlite
RUN a2enmod rewrite expires
# RUN docker-php-ext-install pdo_mysql
# RUN pecl install xdebug && docker-php-ext-enable xdebug
# COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
WORKDIR $PROJECT
COPY --from=appbuild /usr/src/app/dist ./
RUN rm -rf ./api/*
COPY --from=apibuild /app ./api/
RUN chmod 777 ./api
EXPOSE 80