-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
54 lines (38 loc) · 1.32 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
# Set master image
FROM php:7.4-fpm-alpine
MAINTAINER Rajesh Chaudhary <rajeshisnepali@gmail.com>
# Copy composer.lock and composer.json
#COPY composer.lock composer.json /var/www/
# Set working directory
WORKDIR /var/www
#RUN echo "http://uk.alpinelinux.org/alpine/latest-stable/main" > /etc/apk/repositories
#RUN echo "http://uk.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories
# Install dependencies
RUN apk update && apk add --no-cache \
bash \
alpine-sdk shadow vim curl \
zip libzip-dev \
libpng-dev
# Add and Enable PHP-PDO Extenstions
RUN docker-php-ext-install pdo_mysql zip exif gd
# Add php.ini
RUN cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Add nodejs and npm
RUN apk add --update nodejs npm
# Remove Cache
RUN rm -rf /var/cache/apk/*
# Add user for laravel application
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www
#RUN usermod -u 1000 www-data
# Copy existing application directory permissions
COPY --chown=www:www . /var/www
# Change current user to www
USER www
# Expose port 9000 and start php-fpm server
EXPOSE 9000
CMD ["php-fpm"]
# add function (alias) to bash to home dir
COPY .bashrc /home/www