running w0bm as user
This commit is contained in:
56
Dockerfile
56
Dockerfile
@@ -1,32 +1,40 @@
|
||||
# w0bm legacy
|
||||
# Now build w0bm
|
||||
FROM debian:trixie
|
||||
# Initiate w0bm user
|
||||
RUN useradd -m -s /bin/bash w0bm
|
||||
RUN mkdir /home/w0bm/application
|
||||
RUN chown w0bm:w0bm /home/w0bm/application
|
||||
# PHP & Dependency Setup
|
||||
RUN apt update -y
|
||||
RUN apt install sudo curl vim -y
|
||||
RUN curl -sSL https://packages.sury.org/php/README.txt | bash -x
|
||||
RUN apt update -y
|
||||
RUN apt install php7.1 php7.1-cli php7.1-ctype php7.1-curl php7.1-fileinfo php7.1-fpm php7.1-gd php7.1-iconv php7.1-mysql php7.1-opcache php7.1-pdo php7.1-phar php7.1-tokenizer php7.1-zip php7.1-json php7.1-mbstring php7.1-dom nginx ffmpeg imagemagick git -y
|
||||
# cli
|
||||
RUN sed -i 's/^post_max_size = .*/post_max_size = 500M/' /etc/php/7.1/cli/php.ini
|
||||
RUN sed -i 's/^upload_max_size = .*/upload_max_size = 100M/' /etc/php/7.1/cli/php.ini
|
||||
# fpm
|
||||
RUN sed -i 's/^post_max_size = .*/post_max_size = 500M/' /etc/php/7.1/fpm/php.ini
|
||||
RUN sed -i 's/^upload_max_size = .*/upload_max_size = 100M/' /etc/php/7.1/fpm/php.ini
|
||||
RUN sed -i 's/^user = .*/user = root/' /etc/php/7.1/fpm/pool.d/www.conf
|
||||
RUN sed -i 's/^group = .*/group = root/' /etc/php/7.1/fpm/pool.d/www.conf
|
||||
RUN sed -i 's/^listen.owner = .*/user = root/' /etc/php/7.1/fpm/pool.d/www.conf
|
||||
RUN sed -i 's/^listen.group = .*/group = root/' /etc/php/7.1/fpm/pool.d/www.conf
|
||||
COPY ./conf/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY ./conf/nginx/nginx_w0bm.conf /etc/nginx/conf.d/nginx_w0bm.conf
|
||||
WORKDIR /opt
|
||||
RUN apt install php7.1 php7.1-cli php7.1-ctype php7.1-curl php7.1-fileinfo php7.1-fpm \
|
||||
php7.1-gd php7.1-iconv php7.1-mysql php7.1-opcache php7.1-pdo php7.1-phar \
|
||||
php7.1-tokenizer php7.1-zip php7.1-json php7.1-mbstring php7.1-dom \
|
||||
ffmpeg ffmpegthumbnailer imagemagick git -y
|
||||
# Filesize settings
|
||||
RUN sed -i 's/^post_max_size = .*/post_max_size = 1500M/' /etc/php/7.1/cli/php.ini
|
||||
RUN sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 1500M/' /etc/php/7.1/cli/php.ini
|
||||
# PHP-related filesize settings & user configuration
|
||||
RUN sed -i 's/^post_max_size = .*/post_max_size = 1500M/' /etc/php/7.1/fpm/php.ini
|
||||
RUN sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 1500M/' /etc/php/7.1/fpm/php.ini
|
||||
RUN sed -i 's/^user = .*/user = www-data/' /etc/php/7.1/fpm/pool.d/www.conf
|
||||
RUN sed -i 's/^group = .*/group = www-data/' /etc/php/7.1/fpm/pool.d/www.conf
|
||||
RUN sed -i 's/^listen.owner = .*/user = www-data/' /etc/php/7.1/fpm/pool.d/www.conf
|
||||
RUN sed -i 's/^listen.group = .*/group = www-data/' /etc/php/7.1/fpm/pool.d/www.conf
|
||||
# Build w0bm
|
||||
USER w0bm
|
||||
WORKDIR /home/w0bm/application
|
||||
RUN git clone https://git.lat/w0bm/w0bm.git
|
||||
WORKDIR /opt/w0bm
|
||||
COPY ./conf/.env /opt/w0bm/
|
||||
RUN chown -R www-data:www-data /opt/w0bm
|
||||
WORKDIR /home/w0bm/application/w0bm
|
||||
COPY ./conf/.env /home/w0bm/application/w0bm
|
||||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
RUN php composer-setup.php --2.2
|
||||
RUN php7.1 composer.phar dump-autoload
|
||||
RUN php7.1 composer.phar install --no-scripts
|
||||
RUN rm -rf public/
|
||||
COPY ./conf/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
RUN php composer.phar dump-autoload
|
||||
RUN php composer.phar install --no-scripts
|
||||
WORKDIR /home/w0bm/application/w0bm/public
|
||||
RUN mkdir b thumbs thumbs/beta thumbs/blurred
|
||||
# Launch Application
|
||||
WORKDIR /home/w0bm/application/w0bm
|
||||
ENTRYPOINT ["php", "artisan", "serve", "--host", "0.0.0.0"]
|
||||
|
@@ -1,28 +1,26 @@
|
||||
#w0bm legacy deployment
|
||||
services:
|
||||
w0bm:
|
||||
user: 1000:1000
|
||||
container_name: w0bm
|
||||
image: w0bm:legacy-0.0.20 #public fix?
|
||||
image: w0bm:f-1
|
||||
# hostname: "w0bm.lokal"
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
COMPOSER_ALLOW_SUPERUSER: 1
|
||||
depends_on:
|
||||
- mariadb
|
||||
networks:
|
||||
- w0bm
|
||||
# For later
|
||||
volumes:
|
||||
- ./w0bm/public:/opt/w0bm/public
|
||||
# - ./w0bm-data/logs/:/opt/w0bm/storage/logs/
|
||||
# - ./w0bm-data/b/:/opt/w0bm/public/b/
|
||||
# - ./w0bm-data/thumbs/:/opt/w0bm/public/thumbs/
|
||||
# - ./w0bm-data/thumbs/beta/:/opt/w0bm/public/thumbs/beta/
|
||||
# - ./w0bm-data/thumbs/beta/blurred:/opt/w0bm/public/thumbs/beta/blurred/
|
||||
# - ./w0bm-data/images/:/opt/w0bm/public/image/
|
||||
- ./w0bm-data/logs/:/home/w0bm/application/w0bm/storage/logs/
|
||||
- ./w0bm-data/b/:/home/w0bm/application/w0bm/public/b/
|
||||
- ./w0bm-data/thumbs/:/home/w0bm/application/w0bm/public/thumbs/
|
||||
- ./w0bm-data/thumbs/beta/:/home/w0bm/application/w0bm/public/thumbs/beta/
|
||||
- ./w0bm-data/thumbs/beta/blurred:/home/w0bm/application/w0bm/public/thumbs/beta/blurred/
|
||||
- ./w0bm-data/images/:/home/w0bm/application/w0bm/public/image/
|
||||
ports:
|
||||
- "8090:8090"
|
||||
- "8000:800"
|
||||
- "8000:8000"
|
||||
restart: on-failure
|
||||
mariadb:
|
||||
image: mariadb:latest
|
||||
|
Reference in New Issue
Block a user