Skip to content
Snippets Groups Projects
Commit 9eadf408 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Docker image is now working

parent 75edc45e
No related branches found
No related tags found
2 merge requests!1502Development,!1481Resolve "Put MetaGer into our Kubernetes Cluster"
FROM debian:buster
FROM nginx
RUN apt-get update && apt-get install -y \
composer \
php7.2 \
php-mbstring \
php7.2-xml\
php-zip \
php-gd \
php-sqlite3 \
php-mysql \
php-curl \
redis-server \
sqlite3 \
nodejs \
libpng-dev \
unzip \
npm
RUN npm install gulp -g
RUN apt -y update && apt -y install php-fpm \
ca-certificates \
zip \
php7.3-common \
php7.3-curl \
php7.3-mbstring \
php7.3-sqlite3 \
php7.3-xml \
php7.3-zip \
php7.3-redis \
php7.3-gd \
redis-server
COPY . /app
WORKDIR app
RUN mv config/sumas.xml.example config/sumas.xml && mv .env.example .env
RUN composer install --no-plugins --no-scripts
RUN npm install
RUN npm run dev
RUN sed -i 's/listen.owner = www-data/listen.owner = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/listen.group = www-data/listen.group = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/user = www-data/user = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/group = www-data/group = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/7.3/fpm/php.ini && \
mkdir /html
RUN php artisan key:generate
WORKDIR /html
EXPOSE 80
CMD redis-server --daemonize yes && php artisan serve --host=0.0.0.0
COPY config/nginx.conf /etc/nginx/nginx.conf
COPY config/nginx-default.conf /etc/nginx/conf.d/default.conf
COPY . /html
EXPOSE 8000
CMD /etc/init.d/php7.3-fpm start && /etc/init.d/nginx start && /etc/init.d/redis-server start && php artisan worker:spawner
server {
listen 80;
server_name localhost;
root /html/public;
index index.php index.html index.htm;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
\ No newline at end of file
user nginx;
worker_processes 100;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment