forked from RailwayStations/RSWebsite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
56 lines (39 loc) · 1.41 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
FROM composer:latest AS composer-installer
WORKDIR /var/www/rs-website
COPY composer.json .
COPY composer.lock .
RUN composer install
FROM node:latest AS npm-installer
WORKDIR /var/www/rs-website
COPY package*.json ./
RUN npm ci --unsafe-perm
COPY ./js ./js
COPY ./json ./json
COPY ./css ./css
COPY ./i18n ./i18n
COPY ./scripts ./scripts
COPY ./webpack.config.js ./webpack.config.js
COPY ./postcss.config.js ./postcss.config.js
COPY ./config-template.json ./
RUN mkdir -p ./map/json
ENV NODE_OPTIONS=--openssl-legacy-provider
RUN npm run build
FROM php:7.4-apache
EXPOSE 80
ENV APACHE_DOCUMENT_ROOT=/var/www/rs-website/map
ENV API_URL=https://api.railway-stations.org/
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
WORKDIR /var/www/rs-website
COPY ./i18n ./i18n
COPY ./map ./map
COPY ./php ./php
COPY ./config-template.json ./
COPY ./entrypoint.sh ./
COPY --from=composer-installer /var/www/rs-website/vendor ./vendor
COPY --from=npm-installer /var/www/rs-website/map/json ./map/json
COPY --from=npm-installer /var/www/rs-website/map/css ./map/css
COPY --from=npm-installer /var/www/rs-website/map/fonts ./map/fonts
COPY --from=npm-installer /var/www/rs-website/map/js ./map/js
RUN chown -R www-data:www-data /var/www/rs-website
ENTRYPOINT ["bash", "entrypoint.sh"]