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

Put prebuild html in package as doc #1178

Closed
adfslslddkds opened this issue Nov 17, 2021 · 6 comments · Fixed by #1508
Closed

Put prebuild html in package as doc #1178

adfslslddkds opened this issue Nov 17, 2021 · 6 comments · Fixed by #1508
Milestone

Comments

@adfslslddkds
Copy link
Contributor

Remark42 source code comes with remark42 website source code, which contains documentation. Isn't it a good idea to put pre-build html as well? Some github action can build html from source if it changes and put in some folder inside repository for example "doc". So user can just start webserver and read doc without any worry if node.js dependencies work well.

Actually now there some problem with docker in "site" folder. It does not build static files to build folder. It looks like Dockerfile used for some production with reproxy webserver.

@umputun
Copy link
Owner

umputun commented Nov 17, 2021

I'm not sure what the problem is. The current site/Docker file does exactly what it is supposed to do, i.e. build site container. This container serves the site as designed.

So user can just start webserver and read doc without any worry if node.js dependencies work well.

User can do it now, this is why we build the site image

@adfslslddkds
Copy link
Contributor Author

adfslslddkds commented Nov 17, 2021

In current docker-compose file two commads "build" that actually hasn't god any command and "server" that should run "yarn dev" (development webserver) and they both connected to "./build" folder on host. But both of this command useless because they connected to Dockerfile that serves prebuilt static that already stored inside container with reproxy webserver and even has no node.js. It runs correct production image because 'build' in docker-compose file has no command section. But straight production compose can be just with one option run existing container and open some ports.

In readme.md it said that compose can be used for development. So I think it will be good to fix development option or completely remove it.

And static section of issue is because someday build process can be broken. It is the point.

@umputun
Copy link
Owner

umputun commented Nov 17, 2021

to me, this site/docker-compose.yml looks like some artifact from an early development phase

cc @paskal @akellbl4

@paskal
Copy link
Sponsor Collaborator

paskal commented Nov 17, 2021

@akellbl4 must know, it was added deliberately with the new site and should be useful, or fixed if it's not.

@umputun
Copy link
Owner

umputun commented Nov 17, 2021

i think, all we need here is this:

version: '2'
services:
  site:
    image: remark42-site
    build: .
    ports:
      - '8080:8080'

@adfslslddkds
Copy link
Contributor Author

Good for production usage. Also serving static from container with overleyfs it is not a good practice for highload usage because reading from overlayfs in 10 times slower then from a host filesystem. But for this project it should be enough..

paskal added a commit that referenced this issue Oct 3, 2022
Previously, an image built for the `build` service was then used
for `server`, and changes were invisible to the user
before the container rebuild.

After that change, the useless static `build` service is deleted,
Dockerfile is only used in the CI pipeline, and only the `server`
service is left in docker-compose for the user to test
and see documentation changes locally in real-time.

Resolves #1178
umputun pushed a commit that referenced this issue Oct 3, 2022
Previously, an image built for the `build` service was then used
for `server`, and changes were invisible to the user
before the container rebuild.

After that change, the useless static `build` service is deleted,
Dockerfile is only used in the CI pipeline, and only the `server`
service is left in docker-compose for the user to test
and see documentation changes locally in real-time.

Resolves #1178
@paskal paskal added this to the v1.11.0 milestone Jan 15, 2023
itzomen pushed a commit to traleor/comments that referenced this issue Apr 16, 2023
Previously, an image built for the `build` service was then used
for `server`, and changes were invisible to the user
before the container rebuild.

After that change, the useless static `build` service is deleted,
Dockerfile is only used in the CI pipeline, and only the `server`
service is left in docker-compose for the user to test
and see documentation changes locally in real-time.

Resolves umputun#1178
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 a pull request may close this issue.

3 participants