-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (51 loc) · 1.63 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM rust:latest as base
WORKDIR /app
RUN apt-get update && apt-get install -y \
software-properties-common \
fish \
rustfmt \
osm2pgsql \
nodejs \
npm \
gdal-bin \
cmake make libclang-dev libssl-dev pkg-config
RUN cd
RUN git clone https://github.com/strukturag/libheif.git
RUN cd libheif && git checkout tags/v1.18.1 -b v1.18.1
run cd
RUN mkdir build
RUN cd build && cmake --preset=release ../libheif && make && make install
RUN npm i -g esbuild
FROM base as dev
RUN chsh -s $(which fish)
RUN rustup component add rust-analyzer
RUN cargo install cargo-watch
RUN cargo install cargo-edit
RUN cargo install sqlx-cli --no-default-features --features postgres
RUN rustup component add rustfmt
RUN echo "db:5432:carte:postgres:postgres" >> /root/.pgpass
RUN chmod 0600 /root/.pgpass
CMD npm install; cargo watch -x run --ignore tiles --ignore dist
FROM base as build
COPY . .
RUN mkdir -p /app/dist
RUN npm i
RUN esbuild --bundle index.js --outfile=dist/index.js --format=esm
RUN cargo build --release
FROM debian as prod
RUN apt-get update && apt-get install -y \
osm2pgsql \
gdal-bin \
wget
WORKDIR /app
COPY --from=build /app/target/release/veloinfo /app/veloinfo
COPY --from=build /app/migrations /app/migrations
COPY --from=build /app/pub /app/pub
COPY --from=build /app/dist /app/dist
COPY --from=build /app/node_modules /app/node_modules
COPY --from=build /app/import.sh /app/import.sh
COPY --from=build /app/import.lua /app/import.lua
COPY --from=build /usr/local/lib/libheif /usr/local/lib/libheif
RUN echo "db:5432:carte:postgres:postgres" >> /root/.pgpass
RUN chmod 0600 /root/.pgpass
CMD /app/veloinfo