Add MVP
This commit is contained in:
39
Dockerfile
Normal file
39
Dockerfile
Normal file
@ -0,0 +1,39 @@
|
||||
###################
|
||||
### BUILD STAGE ###
|
||||
###################
|
||||
FROM rust:1.47 as build_stage
|
||||
|
||||
# Install build dependencies
|
||||
RUN rustup update &&\
|
||||
rustup default nightly &&\
|
||||
rustup target add x86_64-unknown-linux-musl
|
||||
|
||||
# Build project
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN cargo build --release --target x86_64-unknown-linux-musl
|
||||
RUN strip target/x86_64-unknown-linux-musl/release/stl
|
||||
|
||||
########################
|
||||
### PRODUCTION STAGE ###
|
||||
########################
|
||||
FROM scratch
|
||||
|
||||
# Default to staging environment
|
||||
# Override with "production" when deploying for real
|
||||
ENV ROCKET_ENV="staging"
|
||||
|
||||
ENV ROCKET_TEMPLATE_DIR="/templates"
|
||||
ENV DB_PATH="/database"
|
||||
VOLUME "/database"
|
||||
|
||||
WORKDIR /
|
||||
|
||||
# Copy static files
|
||||
COPY templates templates
|
||||
COPY static static
|
||||
|
||||
# Copy application binary
|
||||
COPY --from=build_stage /app/target/x86_64-unknown-linux-musl/release/stl stl
|
||||
|
||||
CMD ["/stl"]
|
||||
Reference in New Issue
Block a user