-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (28 loc) · 917 Bytes
/
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
# Rust as the base image (MSRV: 1.79)
FROM rust:1.79 AS rust-builder
#RUN cargo install cargo-build-dependencies
RUN cd / && USER=root cargo new --bin lucyleague
WORKDIR /lucyleague
# # If you'd like to just copy over your pre-built files to a cloud server somewhere, uncomment below.
# COPY ./target/release/lucyleague lucyleague
# COPY .env .env
# EXPOSE 8080
# RUN chmod +x ./lucyleague
# CMD ["./lucyleague"]
# Prebuild and cache our dependencies (in case our source changes)
RUN cargo install cargo-build-dependencies
# Copy our manifests
COPY Cargo.toml Cargo.lock ./
RUN cargo build-dependencies
# Copy our source files
RUN mkdir backend-src
COPY src ./src
COPY sql ./sql
# Build our source over our dependencies
RUN cargo build
# Copy environment variables
COPY .env ./.env
COPY .env.production ./.env.production
COPY .env.development ./.env.development
EXPOSE 8080
CMD ["./target/debug/lucyleague"]