These are chat archives for mirumee/saleor

13th
Jul 2018
Sunil Kumar
@sunilsrikumar
Jul 13 2018 09:45
How I can deploy saleor on VM, can anyone give a reference documentation. I'm following django approach but no luck.
Patryk Zawadzki
@patrys
Jul 13 2018 09:47
there’s a Dockerfile and I suggest that you choose docker over full machine emulation
Sunil Kumar
@sunilsrikumar
Jul 13 2018 09:53
Can you please refer doc for deployment with docker?
then follow docker documentation
Sunil Kumar
@sunilsrikumar
Jul 13 2018 10:04
Executed docker build -t storename . after installing docker. Can you please suggest next step
Patryk Zawadzki
@patrys
Jul 13 2018 10:06
do you have Docker running on your server?
Sunil Kumar
@sunilsrikumar
Jul 13 2018 10:06
Patryk Zawadzki
@patrys
Jul 13 2018 10:07
I know too little about your setup to provide commands to run
Kuntal
@Kuntal-KK
Jul 13 2018 10:08
I have a Google Autocomplete address form and I want to save it to the db at the time of placing an order. How can I achieve that?
Patryk Zawadzki
@patrys
Jul 13 2018 10:08
you will need to set the necessary environment variables (like SECRET_KEY and DATABASE_URL)
@Kuntal-KK can you not have it fill the billing/shipping address forms?
Kuntal
@Kuntal-KK
Jul 13 2018 10:09
In place of that form, I want that auto completed form to be saved @patrys
Sunil Kumar
@sunilsrikumar
Jul 13 2018 10:09
@patrys I would like to share the server details, where should I share? I need to deploy on top priority.
Patryk Zawadzki
@patrys
Jul 13 2018 10:10
I mean to use JS to populate the form, you don’t have to necessarily show it to the user, in the end you will need to fill the same fields
@sunilsrikumar I don’t need to know your server details, I can provide guidance if you tell me what software you’re running and whether you use cloud services like AWS or Google Cloud
Sunil Kumar
@sunilsrikumar
Jul 13 2018 10:13
@patrys I'm using amazon AWS VM and I need to deploy it .
Sunil Kumar
@sunilsrikumar
Jul 13 2018 10:14
It seems too complicated to me. Can I use standard django method?
I mean, can i create virutialenv and install all requirements manually and run using gunicorn
Patryk Zawadzki
@patrys
Jul 13 2018 10:16
umm, you probably can but it’s actually the more complex solution of the two and we won’t be able to help past whichever documentation is provided by Django
the Dockerfile provides all the necessary steps you will need to run
please note however that this way you will be building your project on the target server (your production environment) which not only takes time during deployment but will also need you to have Node.js available there
Sunil Kumar
@sunilsrikumar
Jul 13 2018 10:18
@patrys Yes, I followed this doc http://saleor.readthedocs.io/en/latest/gettingstarted/installation-linux.html and install nginx and gunicorn.
Patryk Zawadzki
@patrys
Jul 13 2018 10:19
you probably already have uwsgi which is a more advanced gunicorn replacement but it will work with gunicorn as well
Sunil Kumar
@sunilsrikumar
Jul 13 2018 10:20
Yes, I tried with uwsgi as well. But seems like I'm making some mistake somewhere.
When I'm trying to run on server locally on port 8000, static files are not taking. Do I need to change the static_root as per server
Kuntal
@Kuntal-KK
Jul 13 2018 10:22
from where that form is rendering? which is coming after clicking the Radio button 'Enter a new address'.. @patrys
Patryk Zawadzki
@patrys
Jul 13 2018 10:24
@sunilsrikumar Django is not supposed to serve static files, it places unnecessary stress on the Python server. UWSGI can handle it, see uwsgi.ini and check the path in the static-map setting. Ultimately you should configure Nginx to serve static files and media instead.
@Kuntal-KK search for address_form.html
Kuntal
@Kuntal-KK
Jul 13 2018 10:27
thanks. I will try and get back to u if I face any problem @patrys
Maksych
@Maksych
Jul 13 2018 12:05
Hi all.
I wont to install saleor
But i have a problem
with npm run build-assets
zchlebicki
@zchlebicki
Jul 13 2018 12:10
graphene-file-upload breaks on GET /graphql/ without Content-Type header. graphene-file-upload==0.1.2 should solve it
Pankaj Kumar Singh
@pankaj28843
Jul 13 2018 13:01

Hi,

For some reason SVG icons don't get rendered in Chrome?

https://i.imgur.com/bM9JA9j.png

I see this issue on development as well as production server.

Pankaj Kumar Singh
@pankaj28843
Jul 13 2018 13:06

I am using AWS S3 for STATIC files and MEDIA uploads, but some assets e.g. storefront.js are still pointed to /static/

is it a known issue?

Pankaj Kumar Singh
@pankaj28843
Jul 13 2018 13:14
Everything works fine in Firefox
NyanKiyoshi
@NyanKiyoshi
Jul 13 2018 15:20

I tried on chromium 67.0, I don't have the issue. Are the Cross-Origin rules setup correctly?

You should take a look in the network tab of the inspector and the console and do a hard refresh (CTRL+SHIFT+R) for issues.

Webpack bundles are pointing to the local static storage. To make webpack use the bucket, you can change the environment variable STATIC_URL to the bucket assets URL (https://github.com/NyanKiyoshi/saleor/blob/790235d38/webpack.config.js#L18)
Sunil Kumar
@sunilsrikumar
Jul 13 2018 15:41
@pankaj28843 I got stuck in setting up production system. Can you please help?
Pankaj Kumar Singh
@pankaj28843
Jul 13 2018 15:46
@sunilsrikumar Sure. What is the problem you're facing?
Sunil Kumar
@sunilsrikumar
Jul 13 2018 15:50
Seems like I'm doing something wrong in setting up static and media path. And setting up nginx via uwsgi
Pankaj Kumar Singh
@pankaj28843
Jul 13 2018 15:50
Are you deploying using Docker?
Sunil Kumar
@sunilsrikumar
Jul 13 2018 15:51
No, I'm doing as we do django deployment. I mean, manually setting up virtualenv , installing all requirements, nodejs etc and then configuring uwsgi and nginx.
@pankaj28843 Which method do you use? I'm fine with any approach.
Pankaj Kumar Singh
@pankaj28843
Jul 13 2018 15:55

I am using docker. I pull the latest code on the server, build the docker image and then run the docker container

Redis, ElasticSearch and Postgres are running on my host machine

docker container connects to these

But, for development, I use docker-compose, which comes with these three services

I have a nginx server running on the host machine which proxies all requests to the docker container

Sunil Kumar
@sunilsrikumar
Jul 13 2018 15:57
Shall we connect one to one to help in deployment?
Pankaj Kumar Singh
@pankaj28843
Jul 13 2018 15:59
You can send me a private message on Gitter
Pankaj Kumar Singh
@pankaj28843
Jul 13 2018 17:03

@NyanKiyoshi
I had seen that configuration in webpack config but did not know how to make sure those environment variables are set during Docker build.

I got it working. I had to make some changes to the docker file and pass the build arguments. Everything works as a charm now.

:smile:

NyanKiyoshi
@NyanKiyoshi
Jul 13 2018 23:33
Awesome!