P
P
Pasha2020-12-28 04:49:11
Nginx
Pasha, 2020-12-28 04:49:11

How to easily containerize a typical nodejs project?

Hello,
there is a simple nodejs + mongo project.

I want to containerize it, as well as the mongodb server, nginx, statics and monitoring, in order to easily roll it out on vps and the developer's machine.

I think there are ready-made solutions with pre-configured mongo containers, a web server, etc. for such a simple bootstrap? Who can advise?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sanes, 2020-12-28
@Sanes

to easily roll out on vps and dev machine.

Ansible playbook is written in an hour.

S
Sergey Vinogradov, 2017-02-27
@vinogadovsergey

Here is the file itself:
Options -Indexes
ErrorDocument 404 /404.php
php_flag allow_call_time_pass_reference 1
php_flag session.use_trans_sid off
#php_value display_errors 1
#php_value mbstring.func_overload 2
#php_value mbstring.internal_encoding UTF-8
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{SERVER_PORT} 80$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Redirect www to non-www
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC ]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# Remove index.php from address
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
# Do not apply to the admin panel, otherwise the Highload blocks page will stop working
RewriteCond %{REQUEST_URI} !/bitrix/admin/.* [NC]
RewriteRule (.*? )index\.php/*(.*) /$1$2 [R=301,NE,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{ REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day "

V
Viktor Taran, 2017-02-28
@shambler81

RewriteCond %{HTTP} On
RewriteRule ^.*$ httpы://%{SERVER_NAME}%{REQUEST_URI}

but the redirect may not work. if you have nginx
or a bunch of nginx + apache working on http
in this case, when redirecting to http, you are redirecting to nginx to https, and so on in a circle.
You need to look at the nginx configuration

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question