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

Refactors the program parser trait and clean up some functions, #69

Merged
merged 10 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 24 additions & 25 deletions Api.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
#FROM rust:1.59 as builder
#RUN USER=root cargo new --lib nft_api
#COPY ./programs programs
#WORKDIR ./nft_api
#COPY ./nft_api/CacheCargo.toml ./Cargo.toml
#RUN apt-get update -y && \
# apt-get install -y build-essential make git
#RUN rustup component add rustfmt && \
# rustup toolchain install nightly --component rustfmt --component clippy --allow-downgrade && \
# rustup default nightly
#RUN cargo build --release
#RUN rm src/*.rs
#COPY nft_api .
#RUN rm ./target/release/deps/nft_api*
#RUN cargo build --release
FROM rust:1.60-bullseye as builder
ARG MODE=debug
RUN apt-get update -y && \
apt-get install -y build-essential make git
WORKDIR /rust
RUN USER=root cargo new --lib nft_api
COPY programs /rust/programs
COPY Anchor.toml /rust/programs/
COPY deps /rust/deps
COPY plerkle /rust/plerkle
COPY plerkle_serialization /rust/plerkle_serialization
COPY messenger /rust/messenger
WORKDIR /rust/nft_api
COPY ./nft_api/Cargo.toml ./Cargo.toml

FROM rust:1.59-slim
RUN cargo build

COPY ./nft_api .
RUN cargo build
RUN cp -r /rust/nft_api/target/$MODE /rust/bin

FROM rust:1.61-slim-bullseye
ARG APP=/usr/src/app
RUN apt update \
&& apt install -y ca-certificates tzdata \
&& apt install -y curl ca-certificates tzdata \
&& rm -rf /var/lib/apt/lists/*

ENV TZ=Etc/UTC \
APP_USER=appuser

RUN groupadd $APP_USER \
&& useradd -g $APP_USER $APP_USER \
&& mkdir -p ${APP}

#COPY --from=builder /nft_api/target/release ${APP}

COPY --from=builder /rust/bin ${APP}
RUN chown -R $APP_USER:$APP_USER ${APP}

USER $APP_USER
WORKDIR ${APP}
ENV BIN=/bin/api
CMD ${BIN}
CMD /usr/src/app/nft_api
Loading