Skip to content
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

Provide a docker container for development, or at least update doc #876

Open
kindlydodo opened this issue Aug 15, 2023 · 5 comments · May be fixed by #650
Open

Provide a docker container for development, or at least update doc #876

kindlydodo opened this issue Aug 15, 2023 · 5 comments · May be fixed by #650
Labels
docker Related to deployment with Docker feature A new idea or feature good first issue Good for newcomers help wanted Extra attention is needed
Projects

Comments

@kindlydodo
Copy link

Is your feature request related to a problem? Please describe.
I try to dig into this project. The very first thing I need is an environment. What I have found is:

https://photoview.github.io/en/docs/installation-manual/

To keep my system clean, I would appreciate to use a docker container for development.

Describe the solution you'd like
Provide a dockerfile, or image with an setup development environment for photoview, or at least update the documentation

I’m trying to set up this but I am failing.

Thank you

@kkovaletp
Copy link
Contributor

@kindlydodo I've updated my PR #863 with Docker dev env setup. Please try. Is it what you need?
You could start by reading the comment at the beginning of Dockerfile-dev

@kindlydodo
Copy link
Author

Looks awesome, thank you!
What I try to achieve is to have a container where the ui/ and api/ folder and the uncompiled source files are. This way I can change code and try it out live in my browaer

@kkovaletp
Copy link
Contributor

kkovaletp commented Aug 18, 2023

@kindlydodo Mapping the source code inside the container is easy by adding a new volume to the Photoview service in the docker-compose. However, now it is pretty useless, as you anyway need to recompile the code and reload it on the web server. Right now the code compilation and web server building are done in the same way, as for the production image (at the time of building the image).

To let you see the result of modifying the code on the fly, the development container should run the development web server. For the frontend code, the nodeamon or webpack can be used. For the Golang Realize or Air could be used.

I'm not a developer, so I don't know how exactly to configure these servers to work with this project. The additional challenge might be to make them work together, as now everything is served by the same server, while in this development setup, there should be separate processes (ideally different containers) for the frontend and backend.

So, if you can configure that and make it work, provide me the detailed guide to replicate that in the PR or step in and commit there your working config.

@cicadabear
Copy link
Contributor

If you only want to modify the front end, maybe using a reverse proxy server can be a choice.

npm start -- --port 8003
nginx-1.24.0\conf\nginx.conf

http {
    include       mime.types;
    default_type  application/octet-stream;
	include "D:/code/nginx-1.24.0/sites-enabled/*.conf";  # add this line

nginx-1.24.0\sites-enabled\localhost_8002.conf 

server {
        listen       8002;
        server_name  localhost;
        location /api {
			proxy_pass http://localhost:8000/api;
			proxy_http_version 1.1;
			proxy_set_header Upgrade $http_upgrade;
			proxy_set_header Connection "upgrade";
		}
	location / {
			proxy_pass http://localhost:8003/;
	}	
}

@kkovaletp kkovaletp linked a pull request Apr 29, 2024 that will close this issue
@kkovaletp kkovaletp added this to To do in Roadmap via automation Apr 29, 2024
@kkovaletp kkovaletp added help wanted Extra attention is needed good first issue Good for newcomers feature A new idea or feature docker Related to deployment with Docker labels Apr 29, 2024
@kkovaletp
Copy link
Contributor

We might need to review this issue after #863 is merged to provide a consistent environment. Also, a help from a frontend and backend developer will be needed to correctly configure the nodeamon or an alternative code watching server for both frontend and backend, potentially separating the dev environment to 2 images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Related to deployment with Docker feature A new idea or feature good first issue Good for newcomers help wanted Extra attention is needed
Projects
Roadmap
To do
Development

Successfully merging a pull request may close this issue.

3 participants