mirror of
https://github.com/getlago/lago.git
synced 2025-01-18 16:29:25 +07:00
add api
This commit is contained in:
parent
f20e028d26
commit
34d4af1fb3
89
Dockerfile
89
Dockerfile
@ -1,71 +1,33 @@
|
|||||||
ARG NODE_VERSION=20
|
ARG NODE_VERSION=20
|
||||||
ARG RUBY_VERSION=3.3.4
|
ARG RUBY_VERSION=3.3.4
|
||||||
|
|
||||||
# # Front Build
|
# Front Build
|
||||||
# FROM node:$NODE_VERSION-alpine as front_build
|
FROM node:$NODE_VERSION-alpine as front_build
|
||||||
|
|
||||||
# WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# COPY ./front .
|
COPY ./front/ .
|
||||||
|
|
||||||
# RUN apk add python3 build-base
|
RUN apk add python3 build-base
|
||||||
# RUN yarn && yarn build && npm prune --production
|
RUN yarn && yarn build && npm prune --omit=dev
|
||||||
|
|
||||||
# # API Build
|
# # API Build
|
||||||
# FROM ruby:$RUBY_VERSION-slim as api_build
|
FROM ruby:$RUBY_VERSION-slim as api_build
|
||||||
|
|
||||||
# WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# COPY ./api/Gemfile ./Gemfile
|
COPY ./api/Gemfile ./Gemfile
|
||||||
# COPY ./api/Gemfile.lock ./Gemfile.lock
|
COPY ./api/Gemfile.lock ./Gemfile.lock
|
||||||
|
|
||||||
# RUN apt update -qq && apt install build-essential git pkg-config libpq-dev curl -y
|
RUN apt update -qq && apt install build-essential git pkg-config libpq-dev curl -y
|
||||||
# ENV BUNDLER_VERSION='2.5.5'
|
ENV BUNDLER_VERSION='2.5.5'
|
||||||
# ENV RAILS_ENV=production
|
ENV RAILS_ENV=production
|
||||||
# RUN gem install bundler --no-document -v '2.5.5'
|
RUN gem install bundler --no-document -v '2.5.5'
|
||||||
# RUN bundle config build.nokogiri --use-system-libraries &&\
|
RUN bundle config build.nokogiri --use-system-libraries &&\
|
||||||
# bundle install --jobs=3 --retry=3 --without development test
|
bundle install --jobs=3 --retry=3 --without development test
|
||||||
|
|
||||||
# Final Image
|
# Final Image
|
||||||
# FROM ruby:$RUBY_VERSION-slim
|
FROM ruby:$RUBY_VERSION-slim
|
||||||
# ARG S6_OVERLAY_VERSION=3.2.0.0
|
|
||||||
|
|
||||||
# #RUN apt-get update -qq && apt-get install -y curl gnupg2
|
|
||||||
# #RUN curl http://nginx.org/keys/nginx_signing.key | apt-key add -
|
|
||||||
# RUN apt-get update -qq && \
|
|
||||||
# apt-get install -y nginx xz-utils
|
|
||||||
# # apt-get remove --purge -y gnupg2 && \
|
|
||||||
# # apt-get clean && \
|
|
||||||
# # rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man
|
|
||||||
|
|
||||||
# ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_OVERLAY_VERSION/s6-overlay-noarch.tar.xz /tmp
|
|
||||||
# RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
|
|
||||||
# ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_OVERLAY_VERSION/s6-overlay-x86_64.tar.xz /tmp
|
|
||||||
# RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
|
|
||||||
# RUN rm -rf /tmp/s6-overlay-*.tar.xz
|
|
||||||
|
|
||||||
# COPY ./docker/rootfs /
|
|
||||||
|
|
||||||
# WORKDIR /app
|
|
||||||
|
|
||||||
# COPY --from=front_build /app/dist /usr/share/nginx/html
|
|
||||||
# COPY --from=api_build /usr/local/bundle/ /usr/local/bundle
|
|
||||||
|
|
||||||
# COPY ./front/.env.sh ./front/.env.sh
|
|
||||||
# COPY ./api ./api
|
|
||||||
|
|
||||||
# RUN bash -c ./front/.env.sh
|
|
||||||
|
|
||||||
# COPY ./front/nginx/nginx.conf /etc/nginx/sites-enabled/default
|
|
||||||
|
|
||||||
# ENV RAILS_ENV=production
|
|
||||||
|
|
||||||
# EXPOSE 80
|
|
||||||
# EXPOSE 3000
|
|
||||||
|
|
||||||
# ENTRYPOINT ["/init"]
|
|
||||||
|
|
||||||
FROM ruby:3.3.4-slim
|
|
||||||
ARG S6_OVERLAY_VERSION=3.2.0.0
|
ARG S6_OVERLAY_VERSION=3.2.0.0
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@ -78,7 +40,20 @@ RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
|
|||||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
|
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
|
||||||
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
|
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
|
||||||
|
|
||||||
COPY rootfs /
|
COPY docker/rootfs /
|
||||||
|
COPY ./front/nginx/nginx.conf /etc/nginx/sites-enabled/default
|
||||||
|
|
||||||
|
COPY --from=front_build /app/dist /usr/share/nginx/html
|
||||||
|
COPY --from=api_build /usr/local/bundle/ /usr/local/bundle
|
||||||
|
|
||||||
|
COPY ./front/.env.sh ./front/.env.sh
|
||||||
|
COPY ./api ./api
|
||||||
|
|
||||||
|
RUN bash -c ./front/.env.sh
|
||||||
|
|
||||||
|
ENV RAILS_ENV=production
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
ENTRYPOINT ["/init"]
|
ENTRYPOINT ["/init"]
|
||||||
|
|
||||||
|
3
docker/rootfs/etc/s6-overlay/s6-rc.d/api/run
Normal file
3
docker/rootfs/etc/s6-overlay/s6-rc.d/api/run
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -P
|
||||||
|
cd /app/api
|
||||||
|
./scripts/start.sh
|
@ -1,4 +1,2 @@
|
|||||||
#!/command/with-contenv bash
|
#!/command/execlineb -P
|
||||||
# shellcheck shell=bash
|
nginx
|
||||||
|
|
||||||
nginx -g "daemon off;"
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/command/with-contenv bash
|
|
||||||
|
|
||||||
nginx -g "daemon off;"
|
|
Loading…
Reference in New Issue
Block a user