diff --git a/Dockerfile b/Dockerfile index bbda26f..6d7a0a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,10 +30,15 @@ RUN seq 1 8 | xargs -I{} mkdir -p /usr/share/man/man{} && \ touch .env WORKDIR /app + COPY --from=build /out/diesel /bin/ COPY --from=build /app/target/release/howtocards_server ./ -COPY --from=build /app/migrations ./ + +COPY --from=build /app/src ./src +COPY --from=build /app/migrations ./migrations +COPY --from=build /app/diesel.toml ./ COPY docker-entrypoint.sh ./entrypoint.sh + RUN chmod +x entrypoint.sh && chmod +x howtocards_server ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 00a5b9a..f45621f 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -10,4 +10,4 @@ until PGPASSWORD=${POSTGRES_PASSWORD} psql -h ${DATABASE_HOST} -U ${POSTGRES_USE done >&2 echo "Postgres is up - executing command" -diesel migration run && exec $@ +cd /app && ls . && diesel migration run && exec $@