-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (51 loc) · 2.01 KB
/
Dockerfile
File metadata and controls
66 lines (51 loc) · 2.01 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
# Base image
FROM php:8.3.14-apache
# Information
LABEL maintainer="Slow Ninja <info@slow.ninja>"
# Install symfony package dependencies
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
git \
p7zip-full \
libpq-dev && \
docker-php-ext-install pdo pdo_pgsql
# Install symfony php extension dependences
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions intl \
bcmath
# Install composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php composer-setup.php && \
php -r "unlink('composer-setup.php');" && \
mv composer.phar /usr/local/bin/composer
# Setup git globals for symfony
RUN git config --global user.email structs-webapp@slow.ninja && \
git config --global user.name structs-webapp
# Install symfony
RUN curl -sS https://get.symfony.com/cli/installer | bash && \
mv /root/.symfony5/bin/symfony /usr/local/bin/symfony
# Set the document root
ENV APACHE_DOCUMENT_ROOT /src/public
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
#enable mod_rewrite
RUN a2enmod rewrite
# Copy the source files from the local machine to the container
COPY ./src /src
# Use bash for the shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Create a script file sourced by both interactive and non-interactive bash shells
ENV BASH_ENV /root/.bash_env
RUN touch "${BASH_ENV}"
RUN echo '. "${BASH_ENV}"' >> ~/.bashrc
# Download and install nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | PROFILE="${BASH_ENV}" bash
RUN echo node > .nvmrc
RUN nvm install 22.14.0
WORKDIR /src
# Install PHP project dependencies
#RUN "composer update"
# Install JS project dependencies
RUN npm install