-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
66 lines (46 loc) · 1.43 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
58
59
60
61
62
63
64
65
66
FROM composer:2.8.4 AS composer
COPY ./ /app
WORKDIR /app
# Run composer to install dependencies
RUN composer install \
--optimize-autoloader \
--no-interaction \
--no-progress \
--no-dev
FROM node:20.18.1-alpine3.20 AS node
COPY --from=composer ./app /app/
WORKDIR /app
# Install dependencies with npm
RUN npm ci
# Build (esbuild)
RUN npm run build
FROM php:8.2.26-fpm-alpine3.20
ENV IA_DOCKER=true
# Install packages
RUN apk add --no-cache \
bash \
curl \
nginx \
supervisor
# Copy nginx config
COPY /docker/config/nginx.conf /etc/nginx/nginx.conf
# Copy php-fpm config
COPY /docker/config/fpm-pool.conf /usr/local/etc/php-fpm.d/zz-docker.conf
# Copy supervisord config
COPY /docker/config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Copy code
COPY --from=node /app/dist/ /app/
# Copy daemon bash script
COPY /docker/scripts/daemon.sh /app/backend/daemon.sh
WORKDIR /app
# Create needed folders
RUN mkdir -p /app/backend/data/geoip2 /app/backend/data/logs
# Set owner
RUN chown www-data:www-data /app/data.php /app/index.html && chown -R www-data:www-data /app/static/
# Create symlink for php
RUN ln -s /usr/bin/php82 /usr/bin/php
# Create symlink for php-fpm
RUN ln -s /usr/sbin/php-fpm82 /usr/sbin/php-fpm
# php-fpm hleath check
HEALTHCHECK --interval=60s --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]