-
Notifications
You must be signed in to change notification settings - Fork 5
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
Dockerized the project #3
Conversation
moved the server to its own folder
Hi @relaxgameing , I tried to run the docker-compose file. But, I got the error. Have you checked this in your local system. There are three lines in main.go file related to cors, which are commented. If you uncomment that and run, the project will run in your local system. You have to give MongoDB URI. Please check that. |
Yes I have checked , it run as expected. What I think happen with you is that you ran it with development and you code looks for .env file which is not there so try by making a .env file in server And as per the cors problem that I didn't touch because I didn't wanted to change code and tried to kept it as original as possible, so patch and delete methods are blocked , apply the cors should solve the problem, I will change these and get back to you later. Thank you for replying |
I will check today and confirm the same. |
removed requirement of .env file
i have done the required changes and tested them in my local env now you can make all the requests and removed the requirement for .env file during development mode , |
Hi @relaxgameing , Please try to deploy the project in railway app by yourself. It's free only. If you get any error please let me know. |
You addressed three problems: So for cors we can just use an conditional to add cors only in development And for the environment variables I think having one place for all the env variables is better , we can just add or remove the variables in the compose file ( which would work for both production and development as for development we need our own values and for production you can adjust it while deploying) ( correct me if I am wrong) And regarding the server folder i think seperating the backend and frontend makes sense rather than having backend code in the parent folder of client ( originally) If you accept these solution then I would change the code and I will look into deploying them in railway app and let you know about the results Thank you for replying @vigneshs-dev |
@vigneshs-dev hey i have deployed my updated code in railway and it deployed nicely here is the link https://golang-to-do-app-production-ff7f.up.railway.app/ |
Nice @relaxgameing . Then there will be no problem in merging also. I will merge your code with the main branch. Thank you for your great work and contribution. You have given full effort on this issue. Sooperub dedication. Keep contributing. |
issue:[Feature Request]: Dockerize Golang-To-Do-App #1
dockerized the project ,
changes made
created a docker compose to easily manage the project
changed the project file structure -> moved the backend to it's own server folder