-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (34 loc) · 1012 Bytes
/
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
### Client build stage
FROM node:12-alpine AS frontend
WORKDIR /usr/src/app
COPY ./src/client/ ./
RUN npm install
RUN npm run build
### Composer vendor build stage
FROM composer as vendor
COPY ./src/server/composer.json ./
RUN composer install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist
### Server stage
FROM php:7.3-fpm
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
git \
libpng-dev \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
WORKDIR /usr/src/app
COPY ./src/server ./
RUN mkdir -p ./images/small ./images/medium ./images/large &&\
chmod -R 775 ./images
# Copy built files
COPY --from=vendor /app/vendor/ ./vendor/
COPY --from=frontend /usr/src/app/dist ./public/
EXPOSE 8080
CMD ["php", "-S", "0.0.0.0:8080", "-t", "./public", "./router.php"]