fix: remove dependency of docker image

This commit is contained in:
Kilerd Chan 2018-12-06 14:39:17 +08:00
parent 873f912bf8
commit 0612c1adb9
2 changed files with 31 additions and 1 deletions

View File

@ -4,10 +4,14 @@ COPY . /app
WORKDIR /app
RUN cargo install diesel_cli --no-default-features --features postgres
RUN mkdir -p /out && cp /root/.cargo/bin/diesel /out/
RUN cargo build --release
FROM clux/diesel-cli
FROM alpine:latest
COPY --from=builder /out/diesel /bin/
COPY --from=builder /app/migrations /application/migrations
COPY --from=builder /app/Rocket.toml /application/Rocket.toml

26
docker-compose.yml Normal file
View File

@ -0,0 +1,26 @@
version: "3"
services:
rubble:
image: kilerd/rubble
ports:
- "9999:8000"
environment:
DATABASE_URL: postgres://root:password@postgres/rubble
ROCKET_SECRET_KEY: Bqgzqe3zIg2siAS6IBUmL9/50GOW1xDBpxXZgSpFbyM=
depends_on:
- postgres
networks:
- backend
postgres:
image: postgres:9-alpine
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: password
POSTGRES_DB: rubble
networks:
- backend
networks:
backend: