New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docker] The SECRET_KEY setting must not be empty. #3325
Comments
For local development you might want to use Env variables are listed here: https://docs.getsaleor.com/en/latest/gettingstarted/configuration.html |
Hi @Pacu2, this is not for development, it's for production. |
I'm really confused here and I don't know how to deploy using docker. I'm still getting this error. |
Please try |
Are those parameters (-e DATABASE_URL=*** ) referring to docker's postgres? |
It can be any postgres database owned by you. You can run postgresl via docker or buy postgreql from cloud provider. |
But isn't that docker's purpose? To have everything in a single container that doesn't affect the system you're working on? |
Sure, then you can run another postgresql container via docker. You can not setup multiple services in one container. So I would recommend you use |
Thanks for your comment, but isn't that, per say, for development and not for production? |
Or you can run |
IMO, docker-compose can be used for production, only if you setup correctly, such as appropriate environment varialbles. |
Ok, let's see what the maintainers have to say in this. |
Are you sure you have properly set environmental variable Small side note:
Not really. Container comes in and out all the time ("bacterias"), but some data (storage, database) are usually desired to stay the same, regarding application code changes, so you want to have them maintained outside the container. |
Yes, the env command gives the secret_key I set. But I noticed it got reset every time I ssh to my server. |
I added the export command to .bash_profile and now it's persisted. But so is the problem :) |
@jxltom is right. You need to set the environment variable from outside the Docker. Either give it explicitly when starting docker ( |
Thanks for the confirmation. |
UPDATE, the server runs without issues, but when I try to connect to ip:8000 the connection is refused. |
It should be accessed in For accessed via |
I don't think it works: |
Have you you added Besides, are you sure you have never set |
I didn't change anything in that. it's by default. |
It's clear it's running on 8000 but not reachable? |
No, it should like this:
You HAVE TO add |
Interesting. I'm sorry but the deployment documentation lacks content big time. |
It works thanks a lot. |
It is because EXPOSE only make the port be accessed within docker. |
Awersome. Thanks a lot for all the help. |
What I'm trying to achieve
Install and run Saleor on Docker in production
Steps to reproduce the problem
What I expected to happen
Launch the store on port 8000
Screenshots
System information
Operating system: UBUNTU 18.04
Browser:
General questions:
What are the env variables that docker is using and how can I change them?
The text was updated successfully, but these errors were encountered: