Fix docker dev build (#2509)

* Fixing docker dev build.

* Remove volume mount files.

* Fixing pictrs.

* Addressing PR comments.
This commit is contained in:
Dessalines 2022-10-21 11:13:24 -04:00 committed by GitHub
parent aaaea2006c
commit 9ac13a0891
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 60 deletions

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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
}
pictrs: {
url: "http://pictrs:8080/"
# api_key: "API_KEY"
}
opentelemetry_url: "http://otel:4137"
}

View file

@ -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"]