-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.local
46 lines (33 loc) · 1.75 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
ARG RUNNER_IMAGE=php:8.2-fpm-bookworm
FROM php:8.2-fpm-bookworm as builder
WORKDIR /usr/share/nginx/html
RUN set -e
RUN apt-get update && apt-get install -y git zip
FROM $RUNNER_IMAGE as runner
WORKDIR /usr/share/nginx/html
USER root
RUN apt-get update && apt-get install -y git zip libpq-dev nginx && rm -rf /var/lib/apt/lists/*
RUN echo "" >>/usr/local/etc/php-fpm.d/www.conf && echo "pm.status_path = /php_status" >>/usr/local/etc/php-fpm.d/www.conf
RUN docker-php-ext-configure mysqli && docker-php-ext-install mysqli pdo pdo_mysql
RUN mkdir -p /var/run/nginx && chown -R www-data:www-data /var/run/nginx
# installs nvm (Node Version Manager)
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# Install Node.js version 20
RUN /bin/bash -c "source ~/.nvm/nvm.sh && nvm install 20 && nvm alias default 20 && nvm use default"
# Set up NVM environment for www-data user
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> /etc/profile.d/nvm.sh
RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /etc/profile.d/nvm.sh
RUN echo 'export PATH="$NVM_DIR/versions/node/v20.13.1/bin:$PATH"' >> /etc/profile.d/nvm.sh
# RUN touch /var/www/.bashrc
# RUN echo 'export NVM_DIR="$HOME/.nvm"' >> /var/www/.bashrc
# RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /var/www/.bashrc
# RUN echo 'export PATH="$NVM_DIR/versions/node/v20.13.1/bin:$PATH"' >> /var/www/.bashrc
# RUN chown -R www-data:www-data /var/www/.bashrc
# Switch back to www-data user
# USER www-data
# RUN echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc
# RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bashrc
# RUN echo 'export PATH="$NVM_DIR/versions/node/v20.13.1/bin:$PATH"' >> ~/.bashrc
EXPOSE 8080
# ENTRYPOINT ["sh", "/etc/entrypoint.sh"]
CMD ["bash"]