forked from BAWES-Universe/studenthub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-nginx-local
More file actions
112 lines (83 loc) · 3.97 KB
/
Dockerfile-nginx-local
File metadata and controls
112 lines (83 loc) · 3.97 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
FROM php:8.2-fpm
# Install required PHP extensions
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
unzip \
git \
ffmpeg \
nginx \
cron \
vim \
default-mysql-client \
# wkhtmltopdf \
chromium \
#imagemagick \
#curl \
#composer \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo pdo_mysql zip opcache exif
# Install Imagick PHP extension
#RUN apt-get install -y libmagickwand-dev \
# && pecl install imagick \
# && docker-php-ext-enable imagick
#RUN sed -i 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<policy domain="coder" rights="read|write" pattern="PDF" \/>/' /etc/ImageMagick-6/policy.xml
# Install PHP dependencies
#RUN pecl install ffmpeg \
# && docker-php-ext-enable ffmpeg
#COPY ./nginx/basic.conf /etc/nginx/nginx.conf
#COPY ./nginx/basic.conf /etc/nginx/sites-available/basic.conf
#RUN ln -s /etc/nginx/sites-available/basic.conf /etc/nginx/sites-enabled/
RUN ln -s /var/www/html ~/www
# Copy Nginx site configuration files
#COPY ./nginx/development.conf /etc/nginx/conf.d/development.conf
#COPY ./nginx/basic.conf /etc/nginx/conf.d/basic.conf
# Ensure the configuration files have the correct permissions
#RUN chmod 644 /etc/nginx/conf.d/*.conf
# Create sites-available and sites-enabled directories if they don't exist
#RUN mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled
# Create symbolic links to enable the sites
#RUN ln -sf /etc/nginx/conf.d/development.conf /etc/nginx/sites-enabled/
#RUN ln -sf /etc/nginx/conf.d/basic.conf /etc/nginx/sites-enabled/
# Set working directory in the container
WORKDIR /var/www/html
# Copy application files to the container
COPY . /var/www/html
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install puppeteer to convert url to image (using it to generate candidate ID photos)
#RUN curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh
#RUN bash nodesource_setup.sh && apt-get install -y nodejs
##&& apt-get install -y -g npm && npm i puppeteer -g -y
##&& npx puppeteer browsers install
#RUN apt-get -f install -y nodejs gcc g++ make gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libnss3 lsb-release xdg-utils wget libgbm-dev
#RUN npm install --global --unsafe-perm puppeteer
#RUN chmod -R o+rx /usr/local/lib/node_modules/puppeteer/.local-chromium
#RUN node /usr/lib/node_modules/puppeteer/install.mjs
# Set permissions for the web server
#RUN chown -R www-data:www-data /var/www/html \
RUN chmod -R 775 /var/www/html
RUN cd /var/www/html
#RUN composer install
#COPY ./wait-for-it.sh /usr/local/bin/wait-for-it
#RUN chmod +x /usr/local/bin/wait-for-it
COPY ./cron/cronlist /etc/cron.d/cronlist
RUN chmod 0644 /etc/cron.d/cronlist
RUN crontab /etc/cron.d/cronlist
# Start cron service
RUN service cron start
#RUN ./init --env=Krushn-Nginx --overwrite=All
# copy php configuration
COPY ./nginx/php.conf /etc/nginx/php.conf
# load environment specific configuration
COPY ./nginx/basic.conf /etc/nginx/sites-available/basic.conf
RUN ln -s /etc/nginx/sites-available/basic.conf /etc/nginx/sites-enabled/
# run default nginx config
RUN rm /etc/nginx/sites-enabled/default
# Expose port 80
EXPOSE 80
# Start Nginx and PHP-FPM
#CMD ["sh", "-c", "service nginx start && ./yii migrate && php-fpm "]
CMD ["sh", "-c", "composer install && ./init --env=Krushn-Nginx --overwrite=All && ./yii migrate --interactive=0 && service nginx restart && ./deployment.sh && service cron start && php-fpm && tail -f /dev/null"]