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

Steps for hosting this as a binary? #11

Closed
mjdall opened this issue Jan 17, 2019 · 3 comments
Closed

Steps for hosting this as a binary? #11

mjdall opened this issue Jan 17, 2019 · 3 comments

Comments

@mjdall
Copy link

mjdall commented Jan 17, 2019

FROM ubuntu:16.04
MAINTAINER morgan

WORKDIR /
RUN apt-get update -y
RUN apt-get install -y nginx git wget make gcc createrepo

RUN wget https://dl.google.com/go/go1.10.linux-amd64.tar.gz
RUN tar -xvf go1.10.linux-amd64.tar.gz
RUN mv go /usr/local 
ENV GOROOT=/usr/local/go
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH

RUN git clone https://github.com/FINRAOS/yum-nginx-api.git
WORKDIR /yum-nginx-api
RUN go get github.com/FINRAOS/yum-nginx-api
RUN go get github.com/go-ozzo/ozzo-routing
RUN go get github.com/h2non/filetype
RUN go get github.com/spf13/viper
RUN go get github.com/golang/gddo/httputil/header

RUN mv /etc/nginx/mime.types /etc/nginx/mime.types.bak
RUN mv ./nginx/mime.types /etc/nginx/mime.types
RUN mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
RUN mv ./nginx/nginx.conf /etc/nginx/nginx.conf
COPY yumapi.yml .
RUN mkdir /opt/api
RUN make build
RUN yum-config-manager --enable /api/opt
CMD ./yumapi
CMD /etc/init.d/nginx start

EXPOSE 8080

So i'm setting up a docker container to host the binary so I can determine what needs to be installed a server i'm using to host an apt and yum repo. Don't really want to do it through a docker container since I already have a yum repo set up but currently dont have a clean way of calling create repo everytime something is posted. Hosting it with that dockerfile and fowarding 8080:8080 and then trying to access will result in a 502. What do you think I am doing wrong?

@marshyski
Copy link
Collaborator

Hello @mjdall thank you for checking out yum-nginx-api. Let me reproduce what you're doing and get back to you by this weekend.

@marshyski
Copy link
Collaborator

Hello @mjdall you don't need to setup NGINX for the API, NGINX is used for serving RPMs if you don't have a yum repo already or its performance is poor. I just updated the project and released a new binary. I've simplified your Dockerfile to use Ubuntu and yumapi binary only. Please let me know if you have any questions.

FROM ubuntu:16.04

WORKDIR /
RUN apt-get update -y
RUN apt-get install -y createrepo curl
RUN echo 'upload_dir: /opt/api' > /yumapi.yaml
RUN mkdir -p /opt/api
RUN curl -LO https://github.com/FINRAOS/yum-nginx-api/releases/download/0.3/yumapi
RUN chmod 0755 /yumapi

CMD /yumapi

EXPOSE 8080

@mjdall
Copy link
Author

mjdall commented Jan 17, 2019

Sweet! Perfect I'll give it a go setting up now. Thank you!

@mjdall mjdall closed this as completed Jan 17, 2019
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

No branches or pull requests

2 participants