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

docker #258

Merged
merged 3 commits into from
Jul 27, 2023
Merged

docker #258

merged 3 commits into from
Jul 27, 2023

Conversation

Li-Gru
Copy link
Contributor

@Li-Gru Li-Gru commented Jul 23, 2023

add Dockerfile + docker-entrypoint.sh
add docker-compose.yaml

@Li-Gru Li-Gru mentioned this pull request Jul 23, 2023
@a0eoc
Copy link
Member

a0eoc commented Jul 24, 2023

Originally that issue was for @vednoc not to forget try come back to it later. Now you're ahead of him!

Tried to compose, got the following:

 => ERROR [app stage-0 7/7] RUN set -x  && for f in web/scss/*.scss; do sassc --style nested --sourcemap=inline -l "$f" "web/static/css/$(basename  1.6s
------                                                                                                                                                   
 > [app stage-0 7/7] RUN set -x  && for f in web/scss/*.scss; do sassc --style nested --sourcemap=inline -l "$f" "web/static/css/$(basename $f .scss).css";done  && go build -v -o bin/userstyles-fonts cmd/userstyles-fonts/main.go  && go build -v -o bin/userstyles-ts cmd/userstyles-ts/main.go  && go build -v -o bin/userstyles -tags "fts5" cmd/userstyles-world/main.go:  
#0 1.085 + basename web/scss/main.scss .scss                                                                                                             
#0 1.087 + sassc --style nested '--sourcemap=inline' -l web/scss/main.scss web/static/css/main.css                                                       
#0 1.179 Error opening output file: No such file or directory
#0 1.182 + basename web/scss/view_redesign.scss .scss
#0 1.183 + sassc --style nested '--sourcemap=inline' -l web/scss/view_redesign.scss web/static/css/view_redesign.css
#0 1.193 Error opening output file: No such file or directory
------
failed to solve: process "/bin/sh -c set -x  && for f in web/scss/*.scss; do sassc --style nested --sourcemap=inline -l \"$f\" \"web/static/css/$(basename $f .scss).css\";done  && go build -v -o bin/userstyles-fonts cmd/userstyles-fonts/main.go  && go build -v -o bin/userstyles-ts cmd/userstyles-ts/main.go  && go build -v -o bin/userstyles -tags \"fts5\" cmd/userstyles-world/main.go" did not complete successfully: exit code: 65

Seems to be some paths or go-specific problem, IDK.

@Li-Gru
Copy link
Contributor Author

Li-Gru commented Jul 24, 2023

@a0eoc
fix
2b25784

@a0eoc
Copy link
Member

a0eoc commented Jul 24, 2023

Now it ran for a little bit longer and gave me package cmd/userstyles-fonts/main.go is not in GOROOT (/usr/local/go/src/cmd/userstyles-fonts/main.go) which is docker/go specific. I had this issue before with Flatpak version of VSCodium but can't offer anything to fix.

I should notice that we do PATH=$PATH:$HOME/go/bin to build it with run tool.

@Li-Gru
Copy link
Contributor Author

Li-Gru commented Jul 24, 2023

@a0eoc
what system are you building on?
I build on macos and linux-debian on docker and podman without any problems...

try git reset --hard ; git clean -fdx before build

@a0eoc
Copy link
Member

a0eoc commented Jul 24, 2023

@Li-Gru yeah there was some git issue which I just noticed and fixed..
Now it works! @vednoc is digging the thing to improve performance so the PR stays for now.

Copy link
Member

@vednoc vednoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for taking the time out of your day to hack on USw and contribute!

Overall, everything looks good. However, as @a0eoc mentioned, development workflow is really slow due to having to rebuild image/container whenever something changes. I propose adding another service/target for development environment, where we'll be able to utilize live reload to drastically speed up and improve this process.

I made a minimal set of changes to test out this idea. Apply the following:

  • tools/run (fixes missing step during setup)
setup() {
         all)
-            setup fonts; setup ts; setup sass
+            setup fonts; setup ts; setup sass; setup go
  • docker-compose.yaml (mount the entire directory)
     build:
       dockerfile: Dockerfile
       context: .
+    volumes:
+      - ".:/src"
     ports: ["3000:3000"]
  • Dockerfile (copy-paste this snippet, and comment out the rest)
FROM docker.io/library/golang:1.20.6-alpine3.18
WORKDIR /src
RUN apk add --no-cache build-base git sassc vips-tools
RUN go install github.com/cosmtrek/air@latest
RUN git config --global safe.directory '*'
COPY . /src
RUN tools/run setup
CMD tools/run watch all

@Li-Gru
Copy link
Contributor Author

Li-Gru commented Jul 24, 2023

@vednoc
does this solve a development or delivery problem?
I saw this as a delivery problem. you don't supply images for local deployment

@vednoc
Copy link
Member

vednoc commented Jul 24, 2023

I believe my changes solve the former, your changes solve the letter. We can combine them to solve both problems. Additionally, I'd like to add some other services to help during development.

@Li-Gru Li-Gru closed this Jul 24, 2023
@vednoc
Copy link
Member

vednoc commented Jul 26, 2023

Hey @Li-Gru, I believe we had a misunderstanding and I'm unsure how to move forward. If you don't mind, I would reopen this PR and merge your changes. Afterwards, I will add a separate configuration that resolves the development problem. My idea was to implement them both in this PR, but I'll take care of the rest since I have it (mostly) figured out.

@Li-Gru
Copy link
Contributor Author

Li-Gru commented Jul 26, 2023

I don't mind, I just solved my problem

@vednoc vednoc reopened this Jul 27, 2023
@vednoc vednoc merged commit f43c0e0 into userstyles-world:dev Jul 27, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants