Open eiddor opened 1 year ago
FWIW - I decided to try to build my own Docker image for the project until Sean gets a chance to update his image (if he decides to do so.)
It seems to work fine as long as the /server/index.js
workaround described on the repo is done. It's fairly basic and I'm sure doesn't follow any Docker best practices, but it works.
FROM node:18-alpine
RUN mkdir /home/node/app
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
WORKDIR /home/node/app
COPY --chown=node:node pi-weather-station/package*.json ./
USER node
RUN npm install
COPY --chown=node:node pi-weather-station/. .
EXPOSE 8080
CMD [ "npm", "start" ]
1) Put the above commands in a file names Dockerfile
in a build directory.
2) git clone https://github.com/elewin/pi-weather-station.git
in that directory
3) Apply the server/index.js
workaround mentioned above.
3) Run: docker build -t weather-station:0.0.1 .
in the build directory.
4) Run the container using your preferred method:
CLI
docker run -itd --name weather-station -p 8080:8080 -v -v appdata:/app weather-station:0.0.1
Docker Compose (my preferred method)
version: '3'
services:
weather-station:
image: weather-station:0.0.1
container_name: weather-station
ports:
- "8080:8080"
volumes:
- appdata:/app
restart: unless-stopped
volumes:
appdata:
Feel free to ping me if you have any questions (or spot any issues).
Hey there,Thank you for sending this. I am in the military and deployed right now but will be back next week. I will look at all of what you have posted when I return. I don’t have a stable connection to test where I am at though. Thank you,Sean @. from my iPhoneOn Nov 4, 2023, at 9:09 AM, Roddie Hasan @.> wrote: FWIW - I decided to try to build my own Docker image for the project until Sean gets a chance to update his image (if he decides to do so.) It seems to work fine as long as the /server/index.js workaround described on the repo is done. It's fairly basic and I'm sure doesn't follow any Docker best practices, but it works. FROM node:18-alpine RUN mkdir /home/node/app RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app WORKDIR /home/node/app COPY --chown=node:node pi-weather-station/package*.json ./ USER node RUN npm install COPY --chown=node:node pi-weather-station/. . EXPOSE 8080 CMD [ "npm", "start" ]
Put the above commands in a file names Dockerfile in a build directory. git clone https://github.com/elewin/pi-weather-station.git in that directory Apply the server/index.js workaround mentioned above. Run: docker build -t weather-station:0.0.1 . in the build directory. Run the container using your preferred method:
CLI docker run -itd --name weather-station -p 8080:8080 -v -v appdata:/app weather-station:0.0.1 Docker Compose (my preferred method) version: '3' services: weather-station: image: weather-station:0.0.1 container_name: weather-station ports:
Feel free to ping me if you have any questions (or spot any issues).
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
Hi there,
Thanks for an excellent project!
Issues are disabled on @SeanRiggs' repo, so I'm posting this here. I'm trying to run the Docker version of the repo on a Raspberry Pi 4, but I get this error:
My Docker Compose file is:
I can run pi-weather-station natively on the Pi and it works fine.