Experimenting with Docker. Doesn't work at the moment.

This commit is contained in:
Azareal 2018-08-10 17:47:53 +10:00
parent 3bb626a294
commit d4db2aa2bb
3 changed files with 43 additions and 0 deletions

8
Dockerfile Normal file
View File

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

28
docker-compose.yml Normal file
View File

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

7
install-docker Normal file
View File

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