working i think

This commit is contained in:
Shihaam Abdul Rahman 2022-11-07 23:39:50 +05:00
commit 7218680efa
Signed by: shihaam
GPG Key ID: 16ADCF6871CB2A56
5 changed files with 87 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
init
init/
init/*
synapse
synapse/
synapse/*

46
Dockerfile Normal file
View File

@ -0,0 +1,46 @@
FROM debian:sid-slim
WORKDIR /root
ARG PHPVERSION=7.4
SHELL ["/bin/bash", "-c"]
#Initial update packges
RUN apt update && apt upgrade -y
# Language setup
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN apt install locales -y \
&& apt auto-remove -y \
&& apt clean -y
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen
# Enable Backports
#RUN echo 'deb http://deb.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/bullseye-backports.list \
# && apt update
# Installing basic tools
RUN apt install bzip2 zip unzip git gnupg2 ca-certificates lsb-release apt-transport-https wget curl nano vim -y --no-install-recommends \
&& apt auto-remove -y \
&& apt clean -y
# Platform-specific prerequisites to run python module
RUN apt install build-essential python3-dev libffi-dev \
python3-pip python3-setuptools sqlite3 \
libssl-dev virtualenv libjpeg-dev libxslt1-dev -y --no-install-recommends
RUN mkdir -p ~/synapse \
&& virtualenv -p python3 ~/env \
&& source ~/env/bin/activate \
&& pip install --upgrade pip \
&& pip install --upgrade setuptools \
&& pip install matrix-synapse
#autostart files
COPY buildfiles/auto_config.sh .
COPY buildfiles/start_services.sh .
RUN chmod +x auto_config.sh
RUN chmod +x start_services.sh
CMD ["./start_services.sh"]

View File

@ -0,0 +1,9 @@
#!/bin/bash
cd /root/synapse
source /root/env/bin/activate
python -m synapse.app.homeserver \
--server-name $SERVERNAME \
--config-path homeserver.yaml \
--generate-config \
--report-stats=$REPORTSTATUS
touch /root/init/init

View File

@ -0,0 +1,9 @@
#!/bin/bash
#auto configs
if ! [ -f /root/init/init ]
then /root/auto_config.sh
fi
cd /root/synapse
source /root/env/bin/activate
synctl start --no-daemonize

16
docker-compose.yml Normal file
View File

@ -0,0 +1,16 @@
version: '3.5'
services:
#########################
app:
build: .
image: git.shihaam.dev/dockerfiles/matrix-synapse
hostname: matrix-synapse
volumes:
- ./init:/root/init
- ./synapse:/root/synapse
ports:
- 8006:80
restart: always
environment:
REPORTSTATUS: 'no'
SERVERNAME: matrix.shihaam.me