-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
46 lines (36 loc) · 1.09 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
#Vue App
FROM node:erbium as vuejs
RUN mkdir -p /opt/app
COPY frontend/ /opt/app
RUN rm -rf /opt/app/node_modules
WORKDIR /opt/app
RUN npm install && npm run build
#Server Dependencies
FROM composer:latest as vendor
WORKDIR /app
COPY api/composer.json composer.json
COPY api/composer.lock composer.lock
RUN composer install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist
#Image
FROM phpswoole/swoole:5.1-php8.3-alpine as base
LABEL authors="David Smith <david@xterm.me>"
RUN apk add --no-cache linux-headers
RUN docker-php-ext-install bcmath && \
docker-php-ext-install sockets && \
docker-php-ext-install pcntl
COPY --chown=www-data:www-data api /opt/app
COPY --chown=www-data:www-data --from=vendor /app/vendor/ /opt/app/vendor
COPY --chown=www-data:www-data --from=vuejs /opt/app/dist/ /opt/app/public
RUN rm -f /opt/app/.env
RUN rm -rf /opt/app/storage/*
RUN chown -R www-data:www-data /opt/app/storage
RUN chmod +x /opt/app/docker/start.sh
WORKDIR /opt/app
EXPOSE 8000
VOLUME ["/opt/app/storage"]
ENTRYPOINT ["docker/start.sh"]