Commit f54d74b76e3407e925459ce7aaa2ae473480fb1a

Authored by George Vlahavas
1 parent 7f26231d18

Run as root

There were complications when running as user 1000. Specifically, it was
impossible to put /var/www on a native docker volume as that would reset
its ownership to root:root, therefore making it impossible for PHP to
write to /var/www.

Showing 1 changed file with 2 additions and 9 deletions

api/Dockerfile View file @ f54d74b
... ... @@ -32,21 +32,14 @@
32 32 # Install composer
33 33 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
34 34  
35   -# Add user for laravel application
36   -RUN groupadd -g 1000 www && \
37   - useradd -u 1000 -ms /bin/bash -g www www
  35 +# Copy existing application directory contents
  36 +COPY . /var/www
38 37  
39   -# Copy existing application directory contents with correct permissions
40   -COPY --chown=1000:1000 . /var/www
41   -
42 38 # Copy PHP configuration
43 39 COPY ./php/local.ini /usr/local/etc/php/conf.d/local.ini
44 40  
45 41 # Use composer to install dependencies
46 42 RUN composer install
47   -
48   -# Change current user to www
49   -USER www
50 43  
51 44 # Expose port 9000 and start php-fpm server
52 45 EXPOSE 9000