-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.php.dev
53 lines (35 loc) · 1.26 KB
/
Dockerfile.php.dev
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
FROM docker.io/webdevops/php:8.2
# Adicionar os caminhos ao PATH
ENV PATH="${PATH}:/var/www/app/vendor/bin"
ENV XDEBUG_MODE=off
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
zip \
unzip \
cron
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN set -eux; \
install-php-extensions \
xdebug
COPY --from=composer:2.4 /usr/bin/composer /usr/bin/composer
# Copia do código fonte do projeto para o container
COPY ./src/app /var/www/app
WORKDIR /var/www
RUN mkdir -p /storage/logs/crontab
RUN touch /storage/logs/crontab/crontab.log
# copy the crontab in a location where it will be parsed by the system
COPY ./docker-compose/php/cron.d/crontab /etc/cron.d/crontab
# owner can read and write into the crontab, group and others can read it
RUN chmod 0644 /etc/cron.d/crontab
# running our crontab using the binary from the package we installed
RUN /usr/bin/crontab /etc/cron.d/crontab
# Set working directory
WORKDIR /var/www/app
# install
# RUN composer install --prefer-dist --no-dev --no-scripts --no-progress --no-interaction
# RUN composer dump-autoload --optimize
# RUN php vendor/bin/phinx seed:run