From: Dessalines Date: Fri, 21 Oct 2022 15:13:24 +0000 (-0400) Subject: Fix docker dev build (#2509) X-Git-Url: http://these/git/%22https:/nerdica.net/%7B%24%7B%60data:application/static/%24%7B%60data:application/%7Bthis.imageSrc.unwrap%28%29%7D?a=commitdiff_plain;h=9ac13a08915f85a6df9ddbae5bf250ab9e2e2c1c;p=lemmy.git Fix docker dev build (#2509) * Fixing docker dev build. * Remove volume mount files. * Fixing pictrs. * Addressing PR comments. --- diff --git a/docker/dev/docker-compose.yml b/docker/dev/docker-compose.yml index 399d79ef..52f987b2 100644 --- a/docker/dev/docker-compose.yml +++ b/docker/dev/docker-compose.yml @@ -25,12 +25,12 @@ services: - lemmy-ui lemmy: - image: dessalines/lemmy:dev + # image: dessalines/lemmy:dev # use this to build your local lemmy server image for development # run docker compose up --build - # build: - # context: ../.. - # dockerfile: docker/dev/Dockerfile + build: + context: ../.. + dockerfile: docker/dev/Dockerfile # this hostname is used in nginx reverse proxy and also for lemmy ui to connect to the backend, do not change hostname: lemmy networks: diff --git a/docker/dev/docker_update.sh b/docker/dev/docker_update.sh index bfbff069..29127b24 100755 --- a/docker/dev/docker_update.sh +++ b/docker/dev/docker_update.sh @@ -7,7 +7,4 @@ set -e mkdir -p volumes/pictrs sudo chown -R 991:991 volumes/pictrs -sudo docker-compose down -sudo docker build ../../ --file ../dev/Dockerfile -t lemmy-dev:latest -sudo docker-compose pull --ignore-pull-failures || true -sudo docker-compose up -d +sudo docker-compose up -d --build diff --git a/docker/dev/docker_update_volume_mount.sh b/docker/dev/docker_update_volume_mount.sh deleted file mode 100755 index b31f3cb7..00000000 --- a/docker/dev/docker_update_volume_mount.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -set -e - -# This script uses a Dockerfile that takes advantage of docker volume mounts, -# And runs on an ubuntu image. A little faster for development than the other -# script - -mkdir -p volumes/pictrs -sudo chown -R 991:991 volumes/pictrs -sudo docker-compose down -sudo docker build ../../ --file ../dev/volume_mount.dockerfile -t lemmy-dev:latest -sudo docker-compose pull --ignore-pull-failures || true -sudo docker-compose up diff --git a/docker/dev/lemmy.hjson b/docker/dev/lemmy.hjson index bd0ec409..23f40520 100644 --- a/docker/dev/lemmy.hjson +++ b/docker/dev/lemmy.hjson @@ -6,20 +6,23 @@ # release / stable version. setup: { - # username for the admin user admin_username: "lemmy" - # password for the admin user admin_password: "lemmylemmy" - # name of the site (can be changed later) site_name: "lemmy-dev" } - opentelemetry_url: "http://otel:4137" + database: { + host: "postgres" + } - # the domain name of your instance (eg "lemmy.ml") hostname: "localhost" - # address where lemmy should listen for incoming requests bind: "0.0.0.0" - # port where lemmy should listen for incoming requests port: 8536 -} \ No newline at end of file + + pictrs: { + url: "http://pictrs:8080/" + # api_key: "API_KEY" + } + + opentelemetry_url: "http://otel:4137" +} diff --git a/docker/dev/volume_mount.dockerfile b/docker/dev/volume_mount.dockerfile deleted file mode 100644 index 52ff5e82..00000000 --- a/docker/dev/volume_mount.dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -# syntax=docker/dockerfile:experimental - -# Warning: this will not pick up migrations unless there are code changes -FROM rust:1 as rust - -ENV HOME=/home/root - -WORKDIR /app - -# Copy the source folders -COPY . ./ -RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs" - -# Build for debug -RUN --mount=type=cache,target=/usr/local/cargo/registry \ - --mount=type=cache,target=/app/target \ - cargo build -RUN --mount=type=cache,target=/app/target \ - cp target/debug/lemmy_server lemmy_server - -FROM ubuntu:20.04 - -# Install libpq for postgres -RUN apt-get update -y -RUN apt-get install -y libpq-dev ca-certificates - -# Copy resources -COPY --from=rust /app/lemmy_server /app/lemmy - -EXPOSE 8536 -CMD ["/app/lemmy"]