bump Snapdrop

This commit is contained in:
nicolas.dorier 2024-08-21 09:17:06 +09:00
parent de2c24f00b
commit dd477e145a
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
5 changed files with 78 additions and 0 deletions

23
Snapdrop/1.1/Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM node:22-bullseye
RUN apt-get update && apt-get install -y git supervisor nginx && rm -rf /var/lib/apt/lists/*
WORKDIR /home/node/app
RUN git clone --depth 1 https://github.com/RobinLinus/snapdrop . && \
cp -r /home/node/app/client/* /usr/share/nginx/html/
WORKDIR /home/node/app/server
RUN npm i
COPY supervisor-conf/*.conf /etc/supervisor/conf.d/
COPY sites-available/*.conf /etc/nginx/sites-available/
RUN groupadd services && \
usermod -a -G services www-data && \
usermod -a -G services node && \
chown -R :services /var/log/supervisor/ && \
chmod -R 770 /var/log/supervisor/ && \
chown -R www-data /var/lib/nginx && \
chown -R www-data /usr/share/nginx/html && \
rm -rf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default && \
ln -s /etc/nginx/sites-available/* /etc/nginx/sites-enabled/
ENTRYPOINT [ "supervisord" ]

View File

@ -0,0 +1,31 @@
server {
listen 8080;
#server_name your.domain;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
expires epoch;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /server {
proxy_connect_timeout 300;
proxy_pass http://localhost:3000;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-for $remote_addr;
}
#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;
}
}

View File

@ -0,0 +1,10 @@
[program:nginx]
user=root
command=/usr/sbin/nginx -g "daemon off;"
autostart=true
stdout_logfile=/var/log/supervisor/nginx_stdout.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=0
stderr_logfile=/var/log/supervisor/nginx_stderr.log
stderr_logfile_maxbytes=5MB
stderr_logfile_backups=0

View File

@ -0,0 +1,11 @@
[program:server]
user=node
directory=/home/node/app/server
command=node index.js
autostart=true
stdout_logfile=/var/log/supervisor/server_stdout.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=0
stderr_logfile=/var/log/supervisor/server_stderr.log
stderr_logfile_maxbytes=5MB
stderr_logfile_backups=0

View File

@ -0,0 +1,3 @@
[supervisord]
nodaemon=true
user=root