Docker and Docker-Compose updates (#13)
* feat: updated docker-compose files to pull an image from docker hub
This commit is contained in:
34
.github/workflows/BuildDockerOnTag.yml
vendored
Normal file
34
.github/workflows/BuildDockerOnTag.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Build Docker Image on New Tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
-
|
||||||
|
name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64 #,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: gaseousgames/gaseousserver:latest,gaseousgames/gaseousserver:${{ github.ref_name}}
|
@@ -7,7 +7,7 @@ COPY . ./
|
|||||||
# Restore as distinct layers
|
# Restore as distinct layers
|
||||||
RUN dotnet restore "gaseous-server/gaseous-server.csproj"
|
RUN dotnet restore "gaseous-server/gaseous-server.csproj"
|
||||||
# Build and publish a release
|
# Build and publish a release
|
||||||
RUN dotnet publish "gaseous-server/gaseous-server.csproj" -c Release -o out
|
RUN dotnet publish "gaseous-server/gaseous-server.csproj" --use-current-runtime --self-contained false -c Release -o out
|
||||||
|
|
||||||
# Build runtime image
|
# Build runtime image
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||||
|
39
docker-compose-build.yml
Normal file
39
docker-compose-build.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
gaseous-server:
|
||||||
|
container_name: gaseous-server
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- gaseous
|
||||||
|
depends_on:
|
||||||
|
- gsdb
|
||||||
|
ports:
|
||||||
|
- 5198:80
|
||||||
|
volumes:
|
||||||
|
- gs:/root/.gaseous-server
|
||||||
|
environment:
|
||||||
|
- dbhost=gsdb
|
||||||
|
- dbuser=root
|
||||||
|
- dbpass=gaseous
|
||||||
|
- igdbclientid=<clientid>
|
||||||
|
- igdbclientsecret=<clientsecret>
|
||||||
|
gsdb:
|
||||||
|
container_name: gsdb
|
||||||
|
image: mysql:8
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- gaseous
|
||||||
|
volumes:
|
||||||
|
- gsdb:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=gaseous
|
||||||
|
- MYSQL_USER=gaseous
|
||||||
|
- MYSQL_PASSWORD=gaseous
|
||||||
|
networks:
|
||||||
|
gaseous:
|
||||||
|
driver: bridge
|
||||||
|
volumes:
|
||||||
|
gs:
|
||||||
|
gsdb:
|
@@ -2,8 +2,7 @@ version: '2'
|
|||||||
services:
|
services:
|
||||||
gaseous-server:
|
gaseous-server:
|
||||||
container_name: gaseous-server
|
container_name: gaseous-server
|
||||||
build:
|
image: gaseousgames/gaseousserver:latest
|
||||||
context: ./
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- gaseous
|
- gaseous
|
||||||
|
Reference in New Issue
Block a user