-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (31 loc) · 952 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
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM rust:latest as builder
RUN USER=root cargo new --bin voidkandy-dot-space
WORKDIR ./voidkandy-dot-space
COPY ./Cargo.toml ./Cargo.toml
RUN cargo build --release
RUN rm src/*.rs
ADD . ./
RUN rm ./target/release/voidkandy-dot-space
RUN cargo build --release
FROM linuxcontainers/debian-slim:latest
ARG APP=/usr/src/app
RUN apt-get update \
&& apt-get install -y ca-certificates tzdata libssl3\
&& rm -rf /var/lib/apt/lists/*
EXPOSE 3000
ENV TZ=Etc/UTC \
APP_USER=appuser
RUN groupadd $APP_USER \
&& useradd -g $APP_USER $APP_USER \
&& mkdir -p ${APP}
COPY --from=builder /voidkandy-dot-space/target/release/voidkandy-dot-space ${APP}/voidkandy-dot-space
RUN chown -R $APP_USER:$APP_USER ${APP}
WORKDIR ${APP}
USER root
ADD public ./public
RUN chown -R $APP_USER:$APP_USER ./public
USER $APP_USER
RUN chmod -R 755 ./public
ADD migrations ./migrations
ADD templates ./templates
CMD ["./voidkandy-dot-space"]