Skip to content

Commit

Permalink
update nginx/php config
Browse files Browse the repository at this point in the history
  • Loading branch information
vgocoder committed Apr 14, 2021
1 parent 1c5e3bd commit 308a852
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1,962 deletions.
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ services:
- redis
restart: unless-stopped
tty: true
ports:
- "8000:8000"
working_dir: /var/www
volumes:
- ./wwwroot:/var/www
- ./php/php.ini:/usr/local/etc/php/php.ini
- ./php/additional.ini:/usr/local/etc/php/conf.d/additional.ini
networks:
- app-network

Expand Down
6 changes: 3 additions & 3 deletions nginx/conf.d/demo.conf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
server {
listen 80;
listen [::]:80;
server_name demo.test;
server_name demo.local;
root /var/www/demo/public;
index index.html index.htm index.php;

#charset koi8-r;
error_log /var/log/nginx/demo.test.error.log;
access_log /var/log/nginx/demo.test.access.log main;
error_log /var/log/nginx/demo.local.error.log;
access_log /var/log/nginx/demo.local.access.log main;

#error_page 404 /404.html;

Expand Down
16 changes: 7 additions & 9 deletions php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@ RUN apk add --no-cache \
&& rm -rf /tmp/pear \
&& apk del -f .build-deps

# Use the default production configuration
RUN cp "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

# Install composer
COPY ./composer.phar /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer

# Set working directory
WORKDIR /var/www
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Use the default production configuration
RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Change current user to www
USER www-data

# Expose port 9000 and start php-fpm server
# Exxpose port 9000 and start php-fpm server
EXPOSE 9000
CMD ["php-fpm"]
CMD ["php-fpm"]
Empty file added php/additional.ini
Empty file.
Loading

0 comments on commit 308a852

Please sign in to comment.