Is it possible to build Go binaries for Windows? #127
Replies: 11 comments 1 reply
-
Yes that is absolutely possible, just navigate to the
But to run the server without docker, you would need to configure a database and how you want to serve the web iterface manually aswell. I suggest you copy If you prefer, you can serve the UI yourself, eg. with apache or nginx, by building the ui with the correct API_ENDPOINT environment variable. Otherwise you can use the go binary to serve the web files by enabling SERVE_UI and copying the builded ui files to a directory called If you need more information, I strongly suggest you to look at the Dockerfile to see how it configures everything. Please not though, that I haven't tested Photoview on Windows, so I don't know if that works. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the detailed guide! I'll try building it this weekend, and post back with progress (and binaries packages if successful). Double-checking, |
Beta Was this translation helpful? Give feedback.
-
Awesome, let me know how it goes. |
Beta Was this translation helpful? Give feedback.
-
Also see this issue #70 (comment) |
Beta Was this translation helpful? Give feedback.
-
I successfully managed to build the server, following your instructions. (not 100% sure about the UI - used what came with the repo; I have NPM installed, so could try running a build of the folder if necessary, though it seemed to already have all the HTML, JS, CSS, etc.). It launches on Windows - looks very promising! I have not, however, managed to successfully test it, as I couldn't get it to successfully connect to installed MySQL. (Wondering if I should continue this issue over on #130, as that is more about databases, and this one is more about building). I have attached the Windows binary package in a 7z (renamed to zip) file, and a text file with the errors I saw. |
Beta Was this translation helpful? Give feedback.
-
It looks like it does connect to the database, but it fails to do the initial database setup. For the UI, you should build it before it can be used, the html, js, css files are not bundled and cannot be used by the browser directly. You should be able to build it with |
Beta Was this translation helpful? Give feedback.
-
I was using MySQL Community Server 8.0.22. Is there a recommended database server/version to use? I have now run a build of the GUI (updated server zip attached), and also typed up all your instructions for building on Windows. |
Beta Was this translation helpful? Give feedback.
-
Okay, MySQL should be fine, though I haven't tested it myself. |
Beta Was this translation helpful? Give feedback.
-
I managed to connect to MariaDB, but it didn't manage to serve the content to the webpages: http://localhost:4001/api: I tried changing the folder structure, so all the files and folders were in an http://localhost:1234: CMD Log:
Thank you so much for the help you've given me, though, and for listening to my rambling and feature requests! Must say, I'm really looking forward to SQLite if it works out! |
Beta Was this translation helpful? Give feedback.
-
No problem, I'm a little curious if it will run on Windows as I haven't tested that. It looks like the server is running in development mode, make sure the environment variable DEVELOPMENT is not set to 1 |
Beta Was this translation helpful? Give feedback.
-
I noticed the readme now mentions serving the GUI with NPM. I wasn't doing that before (I had assumed that the GoLang exe served everything, the JS, CSS, HTML, etc. like filebrowser ); maybe that's why it wasn't working... gotta try again. |
Beta Was this translation helpful? Give feedback.
-
I've seen a fair amount of GoLang projects with binaries for lots of operating systems, and e.g. for Windows servers, it's much better than Docker.
Is it possible to compile this project to a binary (in my case, for Windows)? Not sure which file to point the compiler to.
Beta Was this translation helpful? Give feedback.
All reactions