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

Add example to deploy to fly.io #1

Open
oskarrough opened this issue Feb 3, 2022 · 1 comment
Open

Add example to deploy to fly.io #1

oskarrough opened this issue Feb 3, 2022 · 1 comment

Comments

@oskarrough
Copy link

Hi and thank you for the example. Howeve,r I couldn't figure out how to configure the ports correctly with when deploying to fly.io. Should you find some time to look I think it'd be a nice way to deploy geckos.io.

@ktitaro
Copy link

ktitaro commented Aug 11, 2024

The main challenge with deploying on fly.io appears to be related to the Dockerfile setup. I tried using the example Dockerfile from this repository, but it didn't work for me. After making a few adjustments, I managed to get it working. Apart from the Dockerfile, the deployment process is similar to any other Node.js app. Here is the Dockerfile I used:

FROM ubuntu:22.04
RUN apt-get update && apt-get -y install sudo
RUN useradd -m ubuntu && echo "ubuntu:ubuntu" | chpasswd && adduser ubuntu sudo
RUN sudo apt install curl -yq && sudo apt install cmake -yq

RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && \
  sudo apt-get install -y nodejs && \
  sudo npm install -g npm@latest && \
  sudo npm install -g gitget@latest

WORKDIR /home/ubuntu/app
COPY . .
RUN sudo chown -R ubuntu:ubuntu /home/ubuntu/app
USER ubuntu
RUN npm install
RUN npm run build
ENV NODE_ENV=production
CMD ["npm", "run", "start"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants