-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
57 lines (40 loc) · 1.37 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
FROM node:17.4-alpine As asset_builder
LABEL maintainer="Supernova3339 <[email protected]>"
LABEL description="Easyshortener Dockerfile"
WORKDIR /app
COPY ./package.json ./
COPY ./package-lock.json ./
COPY ./vite.config.js ./
COPY ./postcss.config.js ./
COPY ./tailwind.config.js ./
COPY ./resources ./resources
RUN npm install \
&& npm run build
FROM php:fpm-alpine
WORKDIR /var/www/html
RUN apk add --no-cache zip libzip-dev libpng-dev # Install libpng-dev
COPY --from=asset_builder /app/public/build ./public/build
RUN docker-php-ext-install zip \
&& docker-php-ext-install gd
RUN docker-php-ext-install pdo_mysql \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install opcache \
&& apk add --no-cache \
mariadb-client \
sqlite \
nginx
COPY . ./
RUN cp .env.example .env
RUN mkdir ./database/sqlite \
&& chown -R www-data: /var/www/html \
&& rm -rf ./docker
COPY ./docker/config/easyshortener-php.ini /usr/local/etc/php/conf.d/easyshortener-php.ini
COPY ./docker/config/nginx.conf /etc/nginx/nginx.conf
COPY ./docker/config/site-nginx.conf /etc/nginx/http.d/default.conf
RUN chmod +x ./docker-entrypoint.sh
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN chown -R www-data:www-data *
RUN chmod -R 777 storage
EXPOSE 80
USER root
CMD ["./docker-entrypoint.sh"]