From d4db2aa2bbbd3d7e74a62a58a63703d6c43d8421 Mon Sep 17 00:00:00 2001 From: Azareal Date: Fri, 10 Aug 2018 17:47:53 +1000 Subject: [PATCH] Experimenting with Docker. Doesn't work at the moment. --- Dockerfile | 8 ++++++++ docker-compose.yml | 28 ++++++++++++++++++++++++++++ install-docker | 7 +++++++ 3 files changed, 43 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 install-docker diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..03766c06 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM golang:1.10.3 +RUN git clone https://github.com/Azareal/Gosora +RUN mv Gosora app +ADD . /app/ +WORKDIR /app +RUN ./update-deps-linux +ENTRYPOINT ["install-docker"] +CMD ["/app/run-linux"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..ddda1ce0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ +version: "3" +services: + web: + build: . + environment: + - SERVER_PORT=8080 + - SECURE_SERVER_PORT=9090 + - SITE_NAME=${GOS_SITE_NAME:-Go.sora} + - SITE_SHORT_NAME=${GOS_SHORT_SITE_NAME:-Gs} + - SITE_URL=${GOS_SITE_URL} + - MYSQL_DATABASE=${GOS_DBNAME:-gosora} + - MYSQL_USER=${GOS_DBUSER:-gosora_user} + - MYSQL_PASSWORD=${GOS_DBPASSWORD} + volumes: + - ./:/app + ports: + - "8080:80" + - "9090:443" + depends_on: + - mariadb + mariadb: + environment: + - MYSQL_ROOT_PASSWORD=${GOS_ROOT} + - MYSQL_DATABASE=${GOS_DBNAME:-gosora} + - MYSQL_USER=${GOS_DBUSER:-gosora_user} + - MYSQL_PASSWORD=${GOS_DBPASSWORD} + - MYSQL_ALLOW_EMPTY_PASSWORD=no + image: mariadb \ No newline at end of file diff --git a/install-docker b/install-docker new file mode 100644 index 00000000..eb0717c5 --- /dev/null +++ b/install-docker @@ -0,0 +1,7 @@ +cd ./install +go generate +go build -o Install +mv ./Install .. +cd .. + +./Install --dbType=mysql --dbHost=localhost --dbUser=$MYSQL_USER --dbPassword=$MYSQL_PASSWORD --dbName=$MYSQL_DATABASE --shortSiteName=$SITE_SHORT_NAME --siteName=$SITE_NAME --siteURL=$SITE_URL --serverPort=$SERVER_PORT--secureServerPort=$SECURE_SERVER_PORT \ No newline at end of file