-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
41 lines (31 loc) · 1.09 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
FROM php:8.0
ARG UID=1000
ARG GID=1000
ENV UNAME=docker
RUN groupadd -g $GID -o $UNAME && useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
# Dependancies
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends libpq-dev zip unzip \
&& docker-php-ext-install pdo pdo_pgsql \
&& rm -rf /var/lib/apt/lists/*
# Node/NPM
ENV NODE_VERSION=14.0.0
USER $UNAME
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
ENV NVM_DIR=/home/$UNAME/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} && . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} && \
. "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="$NVM_DIR/versions/node/v${NODE_VERSION}/bin/:${PATH}"
USER root
# Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY ./src /ritsoft
WORKDIR /ritsoft
RUN chown $UNAME -R /ritsoft
USER $UNAME
RUN cd /ritsoft && \
composer install --prefer-dist && \
npm install && \
chmod +x ./startserver.sh && \
chmod +x ./wait_for_it.sh
CMD ["./startserver.sh"]