-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
63 lines (37 loc) · 1.47 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM rust:latest AS base
RUN apt-get update && apt-get install -y openssl libssl-dev python3-venv curl unzip git && rm -rf /var/lib/apt/lists/*
ENV OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu
ENV OPENSSL_INCLUDE_DIR=/usr/include/openssl
RUN echo "Building with git version: $(git --version)"
WORKDIR /app
COPY ./ /app/
RUN python3 -m venv venv && \
. venv/bin/activate && \
pip3 install git-remote-codecommit
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install
RUN echo "Building with awscli version: $(aws --version)"
RUN git config --global credential.helper '!aws codecommit credential-helper $@'
RUN git config --global credential.UseHttpPath true
RUN echo "Building with git config:" && git config --list
RUN rustup install stable
RUN rustup install nightly
FROM node:20 AS react-build
WORKDIR /app
COPY frontend/package.json frontend/yarn.lock /app/
RUN yarn install
COPY frontend/ /app/
RUN yarn build
FROM base AS core-ecs-prebuild
RUN cargo build --release --package core_ecs
FROM base AS core-ecs
COPY --from=core-ecs-prebuild /app/target/release/core_ecs /app/main
COPY --from=react-build /app/build /app/public
WORKDIR /app
CMD ["/app/main"]
FROM base AS compile-lambda-prebuild
RUN cargo build --release --package compile_lambda
FROM base AS compile-lambda
COPY --from=compile-lambda-prebuild /app/target/release/compile_lambda /var/task/
CMD ["/var/task/compile_lambda"]