Open tfsjohan opened 2 years ago
It's a good idea.
Unfortunately, I have no experience with either creating my own docker containers or Raspberry pi. I'll keep this issue open for now.
What kind of setup are you using today?
Skickat från min iPhone
12 jan. 2022 kl. 03:13 skrev Fredrik Lidström @.***>:
It's a good idea.
Unfortunately, I have no experience with either creating my own docker containers or Raspberry pi. I'll keep this issue open for now.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
The public server is hosted on Heroku. I would guess that creating a Docker container for this project should be pretty straightforward. It's basically three parts, that could possibly all be run in the same container for personal usage.
It does already create and populate the database automatically if it connects and the scserver
schema does not exist.
This was fairly easy to do a quick and dirty docker image out of.
Once I managed to figure out the database creation and the token extraction (might be easier with the .env-file creation and the additional step by step in the installation instruction).
FROM node:latest
WORKDIR /opt/smartcharge-dev
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000 ADD start.sh / RUN chmod +x /start.sh
CMD ["/start.sh"]
3. Create start.sh in the root folder of smartcharge-dev source (replace internal_token and http://192.168.0.200:3000 with your ip-adress and exposed port):
node /opt/smartcharge-dev/dist/server/server.js & node /opt/smartcharge-dev/dist/server/agency.js -d internal_token http://192.168.0.200:3000
4. Create docker image
docker build . -t galonias/smartcharge-dev
5. Create docker container
docker run --name smartcharge-dev --network smartcharge -p 3000:3000 -d galonias/smartcharge-dev:latest
Thanks for this @galonias!
What would be the best practice regarding PostgreSQL? How did you set up yours? Typically it's not recommended to use a Dockerized PostgreSQL for production, but I can imagine that it would be very nice and convenient for personal use. Maybe step-by-step instructions on how to set up a PostgreSQL container beside the smartcharge Docker container would be sufficient? What do you think?
although maybe a fully ready-made single-user smartcharge setup with server, worker, and PSQL using docker-compose could be nice in the end
I have a PSQL docker container which I’ve reused for this purpose. I didn’t bother setting up a secondary instance.
Having a dedicated single user in one docker container would be optimal for easy setup. You can probably borrow some inspiration from Teslamate and their docker-compose file, https://docs.teslamate.org/docs/installation/docker
PSQL in a container works perfectly for TeslaMate.
With a good docker-componse file setup is very easy despite having multiple containers.
I think you can get good ideas by looking at the docker setup guide for TeslaMate.
6 sep. 2022 kl. 20:48 skrev galonias @.***>:
I have a PSQL docker container which I’ve reused for this purpose. I didn’t bother setting up a secondary instance.
Having a dedicated single user in one docker container would be optimal for easy setup. You can probably borrow some inspiration from Teslamate and their docker-compose file, https://docs.teslamate.org/docs/installation/docker https://docs.teslamate.org/docs/installation/docker — Reply to this email directly, view it on GitHub https://github.com/fredli74/smartcharge-dev/issues/837#issuecomment-1238527671, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGSBXCUN6ISGYSIRR4LNIDV46GZXANCNFSM5LDUNMOQ. You are receiving this because you authored the thread.
Very interested in this app. Docker would be a great addition. Is it still maintained?
Any plans to add a docker-compose file to simplify installation locally, like on a raspberry pi?