-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.local
86 lines (73 loc) · 2.59 KB
/
Dockerfile.local
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
FROM php:7.4-apache
RUN apt-get update
COPY docker/php.ini /var/www/php.ini
RUN mv "/var/www/php.ini" "$PHP_INI_DIR/php.ini"
RUN a2dissite 000-default.conf
RUN a2dismod autoindex -f
RUN a2enmod rewrite
RUN a2enmod proxy
RUN a2enmod proxy_http
RUN a2enmod headers
COPY docker/apache/local/ports.conf /etc/apache2/ports.conf
COPY docker/apache/local/apache2site.conf /etc/apache2/sites-available/apache2site.conf
RUN a2ensite apache2site.conf
COPY docker/apache/local/apache2admin.conf /etc/apache2/sites-available/apache2admin.conf
RUN a2ensite apache2admin.conf
COPY docker/apache/001default-apache2.conf /etc/apache2/sites-available/001default-apache2.conf
RUN a2ensite 001default-apache2.conf
RUN apt-get install -y -qq \
software-properties-common \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libjpeg-dev \
libzip-dev \
libonig-dev \
zlib1g-dev \
libicu-dev \
unzip \
git \
nano \
cron \
dos2unix \
libcurl4-gnutls-dev \
ca-certificates curl gnupg \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --enable-gd
RUN docker-php-ext-install -j$(nproc) gd zip mbstring mysqli intl
COPY docker/job-cron /etc/cron.d/job-cron
COPY docker/cron-minute.sh /var/www/cron-minute.sh
RUN chmod 0644 /etc/cron.d/job-cron
RUN chmod 0644 /var/www/cron-minute.sh
RUN dos2unix /etc/cron.d/job-cron
RUN dos2unix /var/www/cron-minute.sh
RUN crontab /etc/cron.d/job-cron
RUN touch /var/log/cron.log
RUN chmod 0777 /var/log/cron.log
COPY . /var/www/
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
WORKDIR /var/www
RUN composer install
COPY docker/start.sh /var/www/start.sh
RUN dos2unix /var/www/start.sh
# Readers frontend
ENV NODE_ENV=production
ENV DATABASE_URL=mysql://userDocker:[email protected]:3306/nouse
ENV archiveFileStoreUrl=https://bbcdn.nouse.co.uk/file/nouseOldImageLibrary/archive/public
ENV fileStoreUrl=https://bbcdn.nouse.co.uk/file
ENV LOCAL_DOCKER=true
WORKDIR /tmp
# Install nodejs
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
ENV NODE_MAJOR 20
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get install -y nodejs
# Build
WORKDIR /var/www/readers-frontend
RUN rm -rf dist/
RUN npm i
RUN npx prisma generate
RUN npm run build
# To get in container - docker exec -t -i nouse-container /bin/bash
CMD ["bash","/var/www/start.sh"]