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

Patch and improve Docker deployment process #143

Closed
neon-mmd opened this issue Jul 8, 2023 · 4 comments · Fixed by #144
Closed

Patch and improve Docker deployment process #143

neon-mmd opened this issue Jul 8, 2023 · 4 comments · Fixed by #144

Comments

@neon-mmd
Copy link
Owner

neon-mmd commented Jul 8, 2023

Improve and fix the docker deployment by editing the Dockerfile in the project folder (codebase) to make the workdir path relative and fix the locations of the files to be copied from and to.

FROM rust:latest AS chef
# We only pay the installation cost once,
# it will be cached from the second build onwards
RUN cargo install cargo-chef

-WORKDIR app
+WORKDIR /app

FROM chef AS planner
COPY . . 
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json

# Build application
COPY . .
RUN cargo install --path .

# We do not need the Rust toolchain to run the binary!
FROM gcr.io/distroless/cc-debian11
-COPY --from=builder ./public/ ./public/
-COPY --from=builder ./websurfx/ ./websurfx/
+COPY --from=builder /app/public/ /opt/websurfx/public/
+COPY --from=builder /app/websurfx/config.lua /etc/xdg/websurfx/config.lua
COPY --from=builder /usr/local/cargo/bin/* /usr/local/bin/
CMD ["websurfx"]

Note

  1. To get started contributing make sure to read the contributing.md file for the guidlines on how to contribute in this project
  2. To contribute first fork this project by following this video tutorial if you
    are not familliar with process and add your changes and make a pull request with the changes to this repository and if you
    are new to GitHub then follow this video tutorial to get started
    contributing 🙂 .
@alamin655
Copy link
Collaborator

@neon-mmd Can we add Redis installation and command in here?

@neon-mmd
Copy link
Owner Author

neon-mmd commented Jul 9, 2023

@neon-mmd Can we add Redis installation and command in here?

Yes, actually we could, but we already have it in the docker-compose.yml so I don't think that having it here again would make any sense 🙂 . Also, I feel having it as a seperate docker container will make it much easier to maintain for the end user, so having it in the docker-compose.yml file would be the best idea 🙂 . What do you say??

@alamin655
Copy link
Collaborator

@neon-mmd Can we add Redis installation and command in here?

Yes, actually we could, but we already have it in the docker-compose.yml so I don't think that having it here again would make any sense 🙂 . Also, I feel having it as a seperate docker container will make it much easier to maintain for the end user, so having it in the docker-compose.yml file would be the best idea 🙂 . What do you say??

Well, for me, having it in one Dockerfile will make it easier for deployment in AWS, GCP, and other cloud services.

@neon-mmd
Copy link
Owner Author

neon-mmd commented Jul 9, 2023

@neon-mmd Can we add Redis installation and command in here?

Yes, actually we could, but we already have it in the docker-compose.yml so I don't think that having it here again would make any sense slightly_smiling_face . Also, I feel having it as a seperate docker container will make it much easier to maintain for the end user, so having it in the docker-compose.yml file would be the best idea slightly_smiling_face . What do you say??

Well, for me, having it in one Dockerfile will make it easier for deployment in AWS, GCP, and other cloud services.

I think you can still deploy it easily on AWS, GCP or any other cloud services. I would suggest, you will just need to ssh into the vps and then install docker and docker compose and clone the repository and then run this command:

cd websurfx
docker compose up -d --build

And then you will have Websurfx deployed on the vps. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants