-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile
79 lines (48 loc) · 1.91 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
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM alpine:latest AS datapack
RUN apk add --no-cache git
WORKDIR /app/data
RUN git clone --depth 1 --branch datapack https://github.com/bar-assistant/data.git .
RUN rm -r .git
FROM serversideup/php:8.3-fpm-nginx AS php-base
LABEL org.opencontainers.image.source="https://github.com/karlomikus/bar-assistant"
ENV S6_CMD_WAIT_FOR_SERVICES=1
ENV APP_BASE_DIR=/var/www/cocktails
ENV NGINX_WEBROOT=/var/www/cocktails/public
USER root
RUN install-php-extensions bcmath intl ffi
RUN apt update \
&& apt-get install -y \
sqlite3 \
&& apt-get install -y --no-install-recommends libvips42 \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
USER www-data
WORKDIR ${APP_BASE_DIR}
FROM php-base AS dist
ENV PHP_OPCACHE_ENABLE=1
ENV PHP_OPCACHE_MAX_ACCELERATED_FILES=20000
ENV PHP_OPCACHE_MEMORY_CONSUMPTION=256
ARG BAR_ASSISTANT_VERSION
ENV BAR_ASSISTANT_VERSION=${BAR_ASSISTANT_VERSION:-develop}
COPY --chmod=755 ./resources/docker/dist/init.sh /etc/entrypoint.d/99-bass.sh
COPY --chmod=755 --chown=www-data:www-data ./resources/docker/dist/nginx.conf /etc/nginx/server-opts.d/99-bass.conf
USER root
RUN docker-php-serversideup-s6-init
USER www-data
COPY ./resources/docker/dist/php.ini /usr/local/etc/php/conf.d/zzz-bass-php.ini
COPY --chown=www-data:www-data . .
COPY --from=datapack --chown=www-data:www-data /app/data ./resources/data
RUN composer install --optimize-autoloader --no-dev \
&& sed -i "s/{{VERSION}}/$BAR_ASSISTANT_VERSION/g" ./docs/openapi-generated.yaml \
&& cp .env.dist .env
VOLUME ["$APP_BASE_DIR/storage/bar-assistant"]
FROM php-base AS dev
USER root
ARG USER_ID=1000
ARG GROUP_ID=1000
RUN install-php-extensions xdebug
RUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID && \
docker-php-serversideup-set-file-permissions --owner $USER_ID:$GROUP_ID --service nginx
RUN docker-php-serversideup-s6-init
USER www-data