1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-08-15 07:22:33 +00:00

initial mysql support

This commit is contained in:
Nils Domrose 2019-05-26 23:02:41 +02:00 committed by Nils Domrose
commit ff759397f6
55 changed files with 454 additions and 21 deletions

View file

@ -23,6 +23,9 @@ RUN ls
# we need the Rust compiler and Cargo tooling
FROM rust as build
# set sqlite as default for DB ARG for backward comaptibility
ARG DB=sqlite
# Using bundled SQLite, no need to install it
# RUN apt-get update && apt-get install -y\
# sqlite3\
@ -31,8 +34,8 @@ FROM rust as build
# Install MySQL package
RUN apt-get update && apt-get install -y \
libmysql++-dev \
--no-install-recommends \
libmariadb-dev\
--no-install-recommends\
&& rm -rf /var/lib/apt/lists/*
# Creates a dummy project used to grab dependencies
@ -47,7 +50,7 @@ COPY ./build.rs ./build.rs
# Builds your dependencies and removes the
# dummy project, except the target folder
# This folder contains the compiled dependencies
RUN cargo build --release
RUN cargo build --features ${DB} --release
RUN find . -not -path "./target*" -delete
# Copies the complete project
@ -59,7 +62,7 @@ RUN touch src/main.rs
# Builds again, this time it'll just be
# your actual source files being built
RUN cargo build --release
RUN cargo build --features ${DB} --release
######################## RUNTIME IMAGE ########################
# Create a new stage with a minimal image
@ -74,6 +77,7 @@ ENV ROCKET_WORKERS=10
RUN apt-get update && apt-get install -y\
openssl\
ca-certificates\
libmariadbclient-dev\
--no-install-recommends\
&& rm -rf /var/lib/apt/lists/*