Skip to content

Commit

Permalink
Move Dockerfile to root folder
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed Apr 25, 2022
1 parent a8009e2 commit c372ec1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 65 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ jobs:
OBS_PACKAGE=$OBS_PROJECT/$NAME
osc checkout $OBS_PACKAGE -o $DEST_FOLDER
cp -r packaging/suse/* $DEST_FOLDER
cp Dockerfile $DEST_FOLDER
tar -zcvf $DEST_FOLDER/web.tar.gz --exclude=.git ./
cd $DEST_FOLDER
osc ar
Expand Down
48 changes: 25 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
FROM opensuse/leap AS elixir-build
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN zypper -n addrepo https://download.opensuse.org/repositories/devel:/languages:/erlang/SLE_15_SP3/devel:languages:erlang.repo
RUN zypper -n --gpg-auto-import-keys ref -s
RUN zypper -n in elixir
COPY . /build
WORKDIR /build
ENV MIX_ENV=prod
RUN mix local.rebar --force \
&& mix local.hex --force \
&& mix deps.get

#!BuildTag: trento/trento-web:latest
#!BuildTag: trento/trento-web:%%VERSION%%
#!BuildTag: trento/trento-web:%%VERSION%%-build%RELEASE%
#!UseOBSRepositories

FROM registry.suse.com/bci/nodejs:16 AS assets-build
COPY --from=elixir-build /build /build
WORKDIR /build/assets
RUN npm install
FROM bci/nodejs:16 AS assets-build
ADD web.tar.gz /build/
WORKDIR /build/web/assets
RUN npm run tailwind:build
RUN npm run build

FROM elixir-build AS release
FROM suse/sle15:15.3 AS release
# FLAVOR defined in prjconf, e.g.
# BuildFlags: dockerarg:FLAVOR=Community
ARG FLAVOR=Community
# # Workaround for https://github.com/openSUSE/obs-build/issues/487
RUN zypper --non-interactive in sles-release
RUN zypper -n in elixir elixir-hex erlang-rebar3
COPY --from=assets-build /build /build
WORKDIR /build
WORKDIR /build/web/
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV MIX_ENV=prod
ENV MIX_HOME=/usr/bin
ENV FLAVOR="$FLAVOR"
RUN mix phx.digest
RUN mix release


FROM registry.suse.com/bci/bci-base:15.3 AS trento
FROM suse/sle15:15.3 AS trento
# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.trento
LABEL org.opencontainers.image.source="https://github.com/trento-project/web"
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# tar is required by kubectl cp
RUN zypper -n in tar
WORKDIR /app
COPY --from=release /build/_build/prod/rel/trento .
COPY --from=release /build/web/_build/prod/rel/trento .
EXPOSE 4000/tcp
ENTRYPOINT ["/app/bin/trento"]
42 changes: 0 additions & 42 deletions packaging/suse/Dockerfile

This file was deleted.

0 comments on commit c372ec1

Please sign in to comment.