-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (44 loc) · 1.78 KB
/
Dockerfile
File metadata and controls
62 lines (44 loc) · 1.78 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
# PHP version is overriden in the build file, but a default must be declared here
ARG PHP_VERSION=7.4
FROM devwithlando/php:${PHP_VERSION}-fpm-7
# Upgrade system
RUN apt-get update && apt-get -y upgrade
# Install system tools
RUN apt-get install -y tree nano supervisor sudo cron
# Install locales
RUN apt-get install -y locales locales-all
# Add PHP extension helper
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
# Install PHP extensions
RUN chmod +x /usr/local/bin/install-php-extensions && sync && \
install-php-extensions sqlsrv pdo_sqlsrv sockets
# Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y nodejs
# Instal/update NPM
RUN npm install npm --global
# Install zsh
RUN apt-get install -y zsh
# Set zsh as the default shell
RUN chsh -s /bin/zsh www-data
# Switch to www-data user
USER www-data
# Shell choice fix, since the above chsh does not work in Lando
RUN echo 'if [ -t 1 ]; then\n exec /bin/zsh\nfi' > /var/www/.bashrc
# Install oh-my-zsh
RUN cd /var/www && \
wget https://install.ohmyz.sh -O install.sh && \
CHSH=no RUNZSH=no KEEP_ZSHRC=no sh install.sh && \
rm install.sh
# Download artisan plugin for zsh
RUN git clone https://github.com/jessarcher/zsh-artisan.git ~/.oh-my-zsh/custom/plugins/artisan
# Create default .zshrc in home directory
RUN echo 'export ZSH="$HOME/.oh-my-zsh"\n\
ZSH_THEME="crunch"\n\
plugins=(git laravel composer artisan)\n\
source $ZSH/oh-my-zsh.sh\n' > ~/.zshrc
USER root
# Add www-data user to sudoers, to allow sudo commands in lando events
RUN echo 'www-data ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/www-data
# Setup xdebug log file with proper permissions
RUN touch /tmp/xdebug.log && chmod 666 /tmp/xdebug.log