Merge branch 'docker'
This commit is contained in:
commit
7cbd5f07b6
|
@ -0,0 +1,6 @@
|
||||||
|
server/ui/node_modules
|
||||||
|
server/ui/dist
|
||||||
|
server/service/target
|
||||||
|
new_torrents_fetcher
|
||||||
|
scripts
|
||||||
|
.git
|
|
@ -0,0 +1,33 @@
|
||||||
|
# Torrents.csv Dockerfile
|
||||||
|
|
||||||
|
# Build front end resources
|
||||||
|
FROM node:10 AS node-builder
|
||||||
|
|
||||||
|
ARG UI_PATH=/usr/app/server/ui
|
||||||
|
COPY server/ui ${UI_PATH}
|
||||||
|
WORKDIR ${UI_PATH}
|
||||||
|
ARG ENDPOINT_NAME=0.0.0.0:8080
|
||||||
|
|
||||||
|
RUN echo "export const endpoint = '${ENDPOINT_NAME}';" > src/env.ts
|
||||||
|
RUN yarn
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
|
# Build back end
|
||||||
|
FROM rust:1.30
|
||||||
|
|
||||||
|
# Copy the torrents.csv file
|
||||||
|
COPY torrents.csv /usr/app/
|
||||||
|
|
||||||
|
# Creating a directory to work from
|
||||||
|
ARG SERVICE_PATH=/usr/app/server/service
|
||||||
|
COPY server/service ${SERVICE_PATH}
|
||||||
|
WORKDIR ${SERVICE_PATH}
|
||||||
|
|
||||||
|
COPY --from=node-builder /usr/app/server/ui /usr/app/server/ui
|
||||||
|
RUN ls /usr/app
|
||||||
|
RUN ls /usr/app/server/ui
|
||||||
|
RUN ls /usr/app/server/ui/dist
|
||||||
|
RUN ls /usr/app/server/service
|
||||||
|
|
||||||
|
# Build it
|
||||||
|
RUN cargo build --release
|
|
@ -0,0 +1,8 @@
|
||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
torrents-csv:
|
||||||
|
build: .
|
||||||
|
command: bash -c "cd /usr/app/server/service; cargo run --release"
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
|
@ -28,7 +28,7 @@ fn main() {
|
||||||
// .index_file("index.html"),
|
// .index_file("index.html"),
|
||||||
)
|
)
|
||||||
.finish()
|
.finish()
|
||||||
}).bind("127.0.0.1:8080")
|
}).bind("0.0.0.0:8080")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
export const endpoint = "http://localhost:8080";
|
export const endpoint = "http://0.0.0.0:8080";
|
Loading…
Reference in New Issue