-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
41 lines (34 loc) · 1.01 KB
/
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
# Use latest rust (by explicit version to avoid getting a stale release)
FROM rust:1.58.1
# Set timezone
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Build Dependencies
WORKDIR /telescope
COPY ./Cargo.* ./
RUN mkdir src
RUN echo "fn main() {println!(\"BUILD ARTIFACT! \");}" > src/main.rs
RUN cargo build --release
RUN rm -r target/release/deps/telescope*
RUN cargo doc
RUN rm -r target/doc/telescope*
# Build telescope proper
COPY ./src ./src
COPY ./graphql ./graphql
RUN cargo build --release
# Build documentation
RUN cargo doc
# Copy over statically served files.
COPY ./static ./static
# Move the telescope executable to the working directory
RUN mv ./target/release/telescope ./telescope
# Move generated docs to statically served folder
RUN mv ./target/doc/ ./static/internal_docs
# Remove all other build artifacts
RUN rm -r ./target
# Copy over templates
COPY ./templates ./templates
# Expose telescope's ports
EXPOSE 80
# Run telescope
ENTRYPOINT ./telescope