-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
39 lines (30 loc) · 1011 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
38
39
# Recipe for image for balena.io
FROM resin/raspberry-pi-debian
ENV DATABASE_URL=app.db
ENV ROCKET_ENV=prod
ENV ROCKET_ADDRESS=0.0.0.0
ENV ROCKET_PORT=8080
ADD src /app/src
WORKDIR /app
# update distro to buster: fixes glibc mismatch with open-taffeta
RUN apt-get install software-properties-common
RUN add-apt-repository \
"deb http://raspbian.raspberrypi.org/raspbian/ \
buster main contrib non-free rpi"
RUN apt dist-upgrade && \
apt -y upgrade
# RUN apt install -y libsqlite3-dev
RUN apt-get -yyq autoremove && \
apt-get clean -yyq && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# install rust nightly
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y
# maybe also chrono and r2d2?
RUN cargo install diesel_cli --force --no-default-features --features sqlite
RUN cargo install cargo-watch
COPY Cargo.toml ./Cargo.toml
COPY migrations ./migrations
COPY .env_prod .
RUN cargo build --release
RUN diesel migration run
EXPOSE 8080