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

Public docker image #151

Open
shurick81 opened this issue Sep 22, 2020 · 7 comments
Open

Public docker image #151

shurick81 opened this issue Sep 22, 2020 · 7 comments

Comments

@shurick81
Copy link

Is your feature request related to a problem? Please describe.
The problem is that in order to try this generator, I need to install the generator and dependencies.

Describe the solution you'd like
If there was a public image in Docker Hub, I could just run one command to generate the solution on any machine with docker installed.

Describe alternatives you've considered
What we might start with is providing the Dockerfile that other people can use for building an image locally.

@wictorwilen wictorwilen added this to the 2.16.0 milestone Oct 13, 2020
@wictorwilen
Copy link
Member

Thanks for the idea, and you're reading my mind. I do have a Dockerfile already in the upcoming preview - stay tuned

@wictorwilen
Copy link
Member

@shurick81 - here's the Dockerfile I've been using for a project. Any comments, thoughts or additions?

FROM node:14 AS BUILD_IMAGE

RUN curl -sfL https://install.goreleaser.com/github.com/tj/node-prune.sh | bash -s -- -b /usr/local/bin

WORKDIR /app

COPY . /app/

# install 
RUN npm install 

# build
RUN npm run build

# remove development dependencies
RUN npm prune --production

# run node prune
RUN /usr/local/bin/node-prune

FROM node:14-alpine

WORKDIR /app

# copy from build image
COPY --from=BUILD_IMAGE /app/dist ./dist
COPY --from=BUILD_IMAGE /app/node_modules ./node_modules

ENV DEBUG msteams

EXPOSE 3007

CMD [ "node", "dist/server.js" ]

@shurick81
Copy link
Author

@wictorwilen is that an image that one can use for scaffolding new Teams solutions or for building those? Sorry I'm having a hard time figuring this out. That is more or less Dockerfile that I was thinking of when it comes to scaffolding:

FROM node:14-alpine

RUN npm i -g yo [email protected]

VOLUME /usr/app/teams
WORKDIR /usr/app/teams
RUN sed -i -e /rootCheck/d /usr/local/lib/node_modules/yo/lib/cli.js

CMD /bin/bash

And then the usage of the image:

docker run -it --rm -v ${pwd}:/usr/app/teams generator-teams:2.15.0.2 yo teams

@wictorwilen
Copy link
Member

Gotcha! This was more meant for publishing the application.

@wictorwilen
Copy link
Member

@shurick81 - what if you helped with testing this, and then we could automate this through Github actions and automatically publish a new version every time there's a new release?

@shurick81
Copy link
Author

Sure, I'm in. I will test the one that you shared for the publishing the application and I will get back to you.

@shurick81
Copy link
Author

shurick81 commented Oct 19, 2020

I have looked at the image you provided, it looks good for testing and hosting purposes. For example, a way to run it will be using some commandline like docker run -it --rm -p 3007:3007 generator-teams:2.15.0.3. Am I taking it right? However, it is not something one should put on a public registry, or?

How about taking a step back and trying to figure out all the possible use cases and then we see how we can facilitate these use cases via publishing some reusable snippets and images. Here's my ideas for use cases:

  1. Scaffolding the solution.
  • Speaking by programming language, yo teams or should we even consider yo @microsoft/sharepoint depending on the desirable scenario?
  • Who is doing: senior developer.
  1. Installing local dependencies in a subfolder of the solution.
  • This part is usually done as a part of scaffolding but also independently, when the source code is shared among different development environments. Speaking by programming language, npm install.
  • Who is doing: any developer or build pipeline.
  1. Debugging.
  • There might be few subscenarios, like gulp serve, gulp ngrok-serve.
  • Who is doing: any developer.
  1. Building.
  • In programming, it might be npm run build and gulp manifest.
  • Who is doing: senior developer, who is manually building release artifacts or build pipeline.
  1. Hosting.
  • This is running the application for stage environment or for production. Can be running with use of Azure container instance, Azure Web App, SharePoint etc.
  • Who is doing: SysOps or deployment pipeline.

So let's check if I got it incorrectly and then we can discuss what exactly we should help developers with?

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

No branches or pull requests

2 participants