-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
93 lines (77 loc) · 4.4 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
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
87
88
89
90
91
92
93
FROM php:8.4-apache
ARG DEBIAN_FRONTEND=noninteractive
# ----------------------------------------------------------------------------------------------------------------------
USER root
# Add User
RUN useradd -m lion && echo 'lion:lion' | chpasswd && usermod -aG sudo lion && usermod -s /bin/bash lion
# Dependencies
RUN apt-get update -y \
&& apt-get install -y sudo nano zsh git default-mysql-client curl wget unzip cron sendmail golang-go \
&& apt-get install -y libpq-dev libpng-dev libzip-dev zlib1g-dev libonig-dev supervisor libevent-dev libssl-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Electron-Vite Dependencies
RUN apt-get update -y \
&& apt-get install -y libnss3 mesa-utils libgl1-mesa-glx mesa-utils-extra libx11-xcb1 libxcb-dri3-0 libxtst6 \
&& apt-get install -y libasound2 libgtk-3-0 libcups2 libatk-bridge2.0 libatk1.0 libcanberra-gtk-module \
&& apt-get install -y libcanberra-gtk3-module dbus libdbus-1-3 dbus-user-session \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Configure PHP-Extensions
RUN pecl install ev redis xdebug \
&& docker-php-ext-install mbstring gd zip pdo pdo_mysql pdo_pgsql \
&& docker-php-ext-enable xdebug redis gd zip pdo_pgsql \
&& a2enmod rewrite
# Configure Xdebug
RUN echo "xdebug.mode=develop,coverage,debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_connect_back=off" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.idekey=docker" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.log=/dev/stdout" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.log_level=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# ----------------------------------------------------------------------------------------------------------------------
USER lion
SHELL ["/bin/bash", "--login", "-i", "-c"]
# Install nvm, Node.js and npm
ENV NVM_DIR="/home/lion/.nvm"
ENV PATH="$NVM_DIR/versions/node/v20/bin:$PATH"
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& source /home/lion/.bashrc \
&& nvm install 20 \
&& npm install -g npm@11
# Install OhMyZsh
RUN sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
# ----------------------------------------------------------------------------------------------------------------------
USER root
SHELL ["/bin/bash", "--login", "-c"]
# Install logo-ls
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then \
wget https://github.com/Yash-Handa/logo-ls/releases/download/v1.3.7/logo-ls_amd64.deb; \
elif [ "$ARCH" = "aarch64" ]; then \
wget https://github.com/Yash-Handa/logo-ls/releases/download/v1.3.7/logo-ls_arm64.deb; \
else \
echo "Unsupported architecture: $ARCH" && exit 1; \
fi && \
dpkg -i logo-ls_*.deb && \
rm logo-ls_*.deb && \
curl https://raw.githubusercontent.com/UTFeight/logo-ls-modernized/master/INSTALL | bash
# Add configuration in .zshrc
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> /home/lion/.zshrc \
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /home/lion/.zshrc \
&& echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> /home/lion/.zshrc \
&& echo 'alias ls="logo-ls"' >> /home/lion/.zshrc \
&& source /home/lion/.zshrc
# ----------------------------------------------------------------------------------------------------------------------
# Copy Data
COPY . .
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# ----------------------------------------------------------------------------------------------------------------------
# Init Project
CMD touch storage/logs/server.log storage/logs/socket.log storage/logs/supervisord.log storage/logs/test-coverage.log \
&& /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf