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 docker-compose support #82

Closed
wants to merge 3 commits into from
Closed

Add docker-compose support #82

wants to merge 3 commits into from

Conversation

Lensual
Copy link
Contributor

@Lensual Lensual commented Jul 10, 2024

#81

@Lensual
Copy link
Contributor Author

Lensual commented Jul 10, 2024

目前 playground 依赖的 NEXT_PUBLIC_REQUEST_URL 环境变量只在编译时有效,修改后需要重新 docker compose build

next框架不太熟悉

@cyfyifanchen cyfyifanchen added the question Further information is requested label Jul 12, 2024
@cyfyifanchen
Copy link
Collaborator

I had a brief discussion with the other engineers yesterday. We believe that most web developers should already be familiar with how node and nvm work, which is why we’re not using docker compose build.

However, @Lensual, your point is still valid for developers who aren’t as familiar with web development tech stack . I’ll mark the issue with the question label and see what the other engineers have to say about it.

@cyfyifanchen
Copy link
Collaborator

Something worth mentioning: we are at the AdventureX 2024 Hangzhou Hackathon. It’s clear that many developers aren’t familiar with the challenges of using Node.js and nvm, especially when dealing with AI, where Python and its environment are predominant.

This makes me think that having a docker-compose file is the right approach. It solves a lot of pain when getting the entire framework up and running.

@sunshinexcode
Copy link
Collaborator

@Lensual
docker-compose build astra_playground 会报错, 不能构建出镜像

1.playground/.env.example 后续这个会移除
2..env.sample 这个建议不这样用, docker-compose.yml 改成 docker-compose.yml.example 类似, 使用的时候拷贝一个命名为 docker-compose.yml, 并修改环境变量值

Copy link
Collaborator

Choose a reason for hiding this comment

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

you can use the following code:

FROM node:20-alpine AS base

FROM base AS builder

WORKDIR /app

COPY . .

RUN npm i && \
    npm run build


FROM base AS runner

WORKDIR /app

ENV NODE_ENV production

RUN mkdir .next

COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static

EXPOSE 3000

CMD HOSTNAME="0.0.0.0" node server.js

@cyfyifanchen
Copy link
Collaborator

@Lensual We have concluded that having docker-compose is the right thing to do for improving DX. @sunshinexcode will raise a PR for the change. Feel free to review it.

@sunshinexcode
Copy link
Collaborator

PR: #123

@cyfyifanchen
Copy link
Collaborator

@Lensual take a look, if #123 is something you intended to do in the first place? Also from your perspective, which is someone who doesn't know the web development very well, do you think having this docker-compose is gonna boost the EX overall?

@Lensual
Copy link
Contributor Author

Lensual commented Aug 8, 2024

@Lensual take a look, if #123 is something you intended to do in the first place? Also from your perspective, which is someone who doesn't know the web development very well, do you think having this docker-compose is gonna boost the EX overall?

Yes, it looks good.

@Lensual Lensual closed this Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feature Request] Thinking about using Docker compose at the root of the project.
3 participants