

The server is accessible from outside through port ++code>80++/code>. The target container architecture is given here: In order to achieve our goal (which is to make each of our services manageable), we use Docker to containerize them. the database should be accessed with a URL and some credentials.This way we won't have any problem of browsers throwing Cross-origin resource sharing issues. the backend should be accessed with the same root URL than our frontend : the API is our second service and will be discovered behind a proxy of our first server.the React application should be served statically by one server : this is our first service.Now let's think about how our services should run in our production environnement : ++pre>FROM postgres:9.5++/pre> Step 2: Draw your target architecture. it should run postgres (which by default expose its ++code>5432++/code> port.We first need to create a ++code>psql.env++/code> configuration file.įinally, we create our Dockerfile with these characteristics: ++code>"serve": "sequelize db:migrate & sequelize db:seed:all & nodemon index.js"++/code> Db Modify your api ++code>package.json++/code> scripts to add the following line it will run migrations and seed our database on startup ! ir should expose its ++code>8080++/code> port (our Node's Express server port).it should create a ++code>/usr/src/api++/code> working directory.it should run node with a command (++code>yarn run serve++/code>).We create our Dockerfile with these characteristics, very similar to our App service characteristics:
#RAILS 5 LIVERELOAD FREE#
In your project, your free to find more usable Docker image such as Ubuntu for example. Here we use one Alpine image in which node lives.

When you need to access your data from a different domain, you need to allow this domain to query the data. Cross-origin resource sharing let another domain access your data. You might have experienced that using a lot of different ports is confusing while developping services locally : it often involves cross-origin resource sharing which need to be allowed.

You can clone it and follow the tutorial.
