mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-21 22:27:08 +00:00
Faster Docker build directly on host
This commit is contained in:
parent
e09a035373
commit
35489a706b
6
.dockerignore
vendored
6
.dockerignore
vendored
|
@ -1,4 +1,6 @@
|
|||
ui/node_modules
|
||||
ui/dist
|
||||
server/target
|
||||
server/target/debug
|
||||
!server/target/debug/lemmy_server
|
||||
server/target/release
|
||||
server/target/debug/incremental
|
||||
.git
|
||||
|
|
16
docker/federation-test/Dockerfile
vendored
Normal file
16
docker/federation-test/Dockerfile
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
FROM ekidd/rust-musl-builder:1.38.0-openssl11
|
||||
|
||||
# Copy resources
|
||||
COPY server/config/defaults.hjson /app/config/defaults.hjson
|
||||
COPY server/target/debug/lemmy_server /app/lemmy
|
||||
COPY ui/dist /app/dist
|
||||
|
||||
USER root
|
||||
RUN mkdir /app/dist/documentation/
|
||||
RUN addgroup --gid 1001 lemmy
|
||||
RUN adduser --disabled-password --shell /bin/sh -u 1001 --ingroup lemmy lemmy
|
||||
RUN chown lemmy:lemmy /app/ -R
|
||||
USER lemmy
|
||||
EXPOSE 8536
|
||||
WORKDIR /app
|
||||
CMD ["/app/lemmy"]
|
12
docker/federation-test/docker-compose.yml
vendored
12
docker/federation-test/docker-compose.yml
vendored
|
@ -2,9 +2,7 @@ version: '3.3'
|
|||
|
||||
services:
|
||||
lemmy_alpha:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: docker/dev/Dockerfile
|
||||
image: lemmy-federation-test:latest
|
||||
ports:
|
||||
- "127.0.0.1:8536:8536"
|
||||
environment:
|
||||
|
@ -15,6 +13,7 @@ services:
|
|||
- LEMMY_FEDERATION_ENABLED=true
|
||||
- LEMMY_FEDERATED_INSTANCE=lemmy_beta:8537
|
||||
- LEMMY_PORT=8536
|
||||
- RUST_BACKTRACE=1
|
||||
restart: always
|
||||
depends_on:
|
||||
- lemmy_db_alpha
|
||||
|
@ -24,6 +23,8 @@ services:
|
|||
- POSTGRES_USER=lemmy
|
||||
- POSTGRES_PASSWORD=${LEMMY_DATABASE_PASSWORD}
|
||||
- POSTGRES_DB=lemmy
|
||||
volumes:
|
||||
- lemmy_db_alpha:/var/lib/postgresql/data
|
||||
restart: always
|
||||
lemmy_pictshare_alpha:
|
||||
image: shtripok/pictshare:latest
|
||||
|
@ -34,9 +35,7 @@ services:
|
|||
restart: always
|
||||
|
||||
lemmy_beta:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: docker/dev/Dockerfile
|
||||
image: lemmy-federation-test:latest
|
||||
ports:
|
||||
- "127.0.0.1:8537:8537"
|
||||
environment:
|
||||
|
@ -47,6 +46,7 @@ services:
|
|||
- LEMMY_FEDERATION_ENABLED=true
|
||||
- LEMMY_FEDERATED_INSTANCE=lemmy_alpha:8536
|
||||
- LEMMY_PORT=8537
|
||||
- RUST_BACKTRACE=1
|
||||
restart: always
|
||||
depends_on:
|
||||
- lemmy_db_beta
|
||||
|
|
14
docker/federation-test/run-federation-test.bash
vendored
Executable file
14
docker/federation-test/run-federation-test.bash
vendored
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
pushd ../../ui/ || exit
|
||||
yarn build
|
||||
popd || exit
|
||||
|
||||
pushd ../../server/ || exit
|
||||
cargo build
|
||||
popd || exit
|
||||
|
||||
sudo docker build ../../ -f Dockerfile -t lemmy-federation-test:latest
|
||||
|
||||
sudo docker-compose up
|
Loading…
Reference in a new issue