Не удается получить доступ к сайту
Сайт localhost не позволяет установить соединение.
Выполните поиск по запросу localhost 9000 в Google
FROM node:latest AS buildContainer
COPY . /app
WORKDIR /app
# Copy dependency definitions
RUN npm install
RUN npm run build
FROM nginx:latest
RUN apt-get update
COPY nginx.conf /etc/nginx/nginx.conf
COPY gzip.conf /etc/nginx/gzip.conf
COPY mime.types /etc/nginx/mime.types
COPY --from=buildContainer /app/dist/ /usr/share/nginx/html
EXPOSE 9000/tcp
user nginx;
worker_processes 4;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format gzip '[$time_local] ' '"$request" $status $bytes_sent';
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
charset utf-8;
sendfile on;
keepalive_timeout 65;
#include /etc/nginx/conf.d/*.conf;
server {
listen 9000;
server_name example.com;
return 301 https://$server_name$request_uri; # enforce https
# rewrite ^(.*) https://www.example.com$uri permanent;
}
server {
listen 9000;
server_name localhost;
access_log /dev/stdout;
root /usr/share/nginx/html;
location / {
try_files $uri$args $uri$args/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
# Compression
include /etc/nginx/gzip.conf;
}
EXPOSE 9000/tcp
, то должно быть норм. Вот, на всякий случай, NGINX.conf:user nginx;
worker_processes 4;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format gzip '[$time_local] ' '"$request" $status $bytes_sent';
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
charset utf-8;
sendfile on;
keepalive_timeout 65;
#include /etc/nginx/conf.d/*.conf;
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri; # enforce https
# rewrite ^(.*) https://www.example.com$uri permanent;
}
server {
listen 443;
server_name localhost;
access_log /dev/stdout;
root /usr/share/nginx/html;
location / {
try_files $uri$args $uri$args/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
# Compression
include /etc/nginx/gzip.conf;
}
PS E:\Dev\Git\nefu-rooms-constructor> docker build -t testapp .
Sending build context to Docker daemon 197.8MB
Step 1/12 : FROM node:latest AS buildContainer
---> de1099630c13
Step 2/12 : COPY . /app
---> ee7405d42d3b
Removing intermediate container 9c3493df21f1
Step 3/12 : WORKDIR /app
---> 8286556652d9
Removing intermediate container b13324392781
Step 4/12 : RUN npm install
---> Running in 4b403a6f009c
npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.5.0
npm info lifecycle nefu-rooms-constructor@0.0.1~preinstall: nefu-rooms-constructor@0.0.1
npm http fetch GET 200 https://registry.npmjs.org/fsevents 871ms
npm http fetch GET 200 https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz 1398ms
npm info linkStuff nefu-rooms-constructor@0.0.1
npm info lifecycle nefu-rooms-constructor@0.0.1~install: nefu-rooms-constructor@0.0.1
npm info lifecycle nefu-rooms-constructor@0.0.1~postinstall: nefu-rooms-constructor@0.0.1
npm info lifecycle nefu-rooms-constructor@0.0.1~prepublish: nefu-rooms-constructor@0.0.1
npm info lifecycle nefu-rooms-constructor@0.0.1~prepare: nefu-rooms-constructor@0.0.1
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm info lifecycle undefined~postshrinkwrap: undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 114 packages in 9.969s
npm info ok
---> 0f6b334030d4
Removing intermediate container 4b403a6f009c
Step 5/12 : RUN npm run build
---> Running in 1587de595f2d
npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.5.0
npm info lifecycle nefu-rooms-constructor@0.0.1~prebuild: nefu-rooms-constructor@0.0.1
npm info lifecycle nefu-rooms-constructor@0.0.1~build: nefu-rooms-constructor@0.0.1
> nefu-rooms-constructor@0.0.1 build /app
> ng build
Date: 2017-09-30T05:12:53.755Z
Hash: 9a05c6f8737b8287d675
Time: 9498ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 127 kB {vendor} [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 209 kB {inline} [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 190 kB {inline} [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 3.04 MB [initial] [rendered]
npm info lifecycle nefu-rooms-constructor@0.0.1~postbuild: nefu-rooms-constructor@0.0.1
npm info ok
---> fd58c4c6f520
Removing intermediate container 1587de595f2d
Step 6/12 : FROM nginx:latest
---> da5939581ac8
Step 7/12 : RUN apt-get update
---> Using cache
---> d7cec7da033c
Step 8/12 : COPY nginx.conf /etc/nginx/nginx.conf
---> Using cache
---> afd18a790ef5
Step 9/12 : COPY gzip.conf /etc/nginx/gzip.conf
---> Using cache
---> f49d5fae7b3f
Step 10/12 : COPY mime.types /etc/nginx/mime.types
---> Using cache
---> 923bd0d45efc
Step 11/12 : COPY --from=buildContainer /app/dist/ /usr/share/nginx/html
---> Using cache
---> bbf179e31051
Step 12/12 : EXPOSE 9000/tcp
---> Running in bb94cbf827f5
---> bb1a7b47fec4
Removing intermediate container bb94cbf827f5
Successfully built bb1a7b47fec4
Successfully tagged testapp:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is reco
mmended to double check and reset permissions for sensitive files and directories.
export interface IFoo {
bar: TBar[]
}
type TBar = {
a: string;
b: number;
}
import {IFoo} from './'
class Imp implements IFoo {
bar: TBar[];
constructor() {
this.bar: [{
a: 'gg',
b: 1}]
}
}
А вообще, нет проблемы использовать телефон с двумя сим-картами, или два телефона, или тасовать карты при необходимости.
var MongoClient = require('mongodb').MongoClient,
format = require('format');
// Use connect method to connect to the Server
MongoClient.connect("mongodb://127.0.0.1:27017/chat", function (err, db) {
if (err) throw err;
var collection = db.collection('test_insert');
collection.insert({
a: 2
}, function (err, docs) {
collection.count(function (err, count) {
console.log(format("count = %s", count));
})
});
collection.find().toArray(function (err, results) {
console.dir(results);
db.close();
})
});