Compare commits
13 Commits
d24ae42ccf
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| bcba4f1030 | |||
| 64ceee2080 | |||
| 8b9906672c | |||
| 252999c990 | |||
| 2ec413e21e | |||
| a203b15639 | |||
| 87546e064d | |||
| f708520371 | |||
| 53da042b20 | |||
| 8b86bb6213 | |||
| 155630f93a | |||
| a421fe69c6 | |||
| 391fae1812 |
28
DockerStack/Dockers/Dashy/dashy-compose.yaml
Normal file
28
DockerStack/Dockers/Dashy/dashy-compose.yaml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
version: "3.8"
|
||||||
|
services:
|
||||||
|
dashy:
|
||||||
|
# To build from source, replace 'image: lissy93/dashy' with 'build: .'
|
||||||
|
# build: .
|
||||||
|
image: lissy93/dashy
|
||||||
|
container_name: Dashy
|
||||||
|
# Pass in your config file below, by specifying the path on your host machine
|
||||||
|
# volumes:
|
||||||
|
# - /root/my-config.yml:/app/user-data/conf.yml
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
# Set any environmental variables
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=production
|
||||||
|
# Specify your user ID and group ID. You can find this by running `id -u` and `id -g`
|
||||||
|
# - UID=1000
|
||||||
|
# - GID=1000
|
||||||
|
# Specify restart policy
|
||||||
|
restart: unless-stopped
|
||||||
|
# Configure healthchecks
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'node', '/app/services/healthcheck']
|
||||||
|
interval: 1m30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 40s
|
||||||
31
DockerStack/Dockers/Homepage/homepage-compose.yaml
Normal file
31
DockerStack/Dockers/Homepage/homepage-compose.yaml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
homepage:
|
||||||
|
image: ghcr.io/gethomepage/homepage:latest
|
||||||
|
container_name: homepage
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 3065:3000
|
||||||
|
expose:
|
||||||
|
- 3065
|
||||||
|
environment:
|
||||||
|
- PUID=1000
|
||||||
|
- PGID=1000
|
||||||
|
- HOMEPAGE_ALLOWED_HOSTS=dockers.localdomain:3065 # add your FQDN here
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro # (optional) For docker integrations
|
||||||
|
- homep_conf:/app/config # Make sure your local config directory exists
|
||||||
|
- homep_ico:/app/public/icons
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
mode: replicated
|
||||||
|
replicas: 3
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
homep_conf:
|
||||||
|
driver: gfs_vol
|
||||||
|
homep_ico:
|
||||||
|
driver: gfs_vol
|
||||||
35
DockerStack/Dockers/Shepherd/shepherd-compose.yaml
Normal file
35
DockerStack/Dockers/Shepherd/shepherd-compose.yaml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: containrrr/shepherd
|
||||||
|
environment:
|
||||||
|
TZ: 'Europe/Copenhagen'
|
||||||
|
FILTER_SERVICES: ''
|
||||||
|
IGNORELIST_SERVICES: ''
|
||||||
|
RUN_ONCE_AND_EXIT: "true"
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
deploy:
|
||||||
|
replicas: 0
|
||||||
|
restart_policy:
|
||||||
|
condition: none
|
||||||
|
labels:
|
||||||
|
- swarm.cronjob.enable=true
|
||||||
|
- swarm.cronjob.schedule=0 1 * * *
|
||||||
|
- swarm.cronjob.skip-running=true
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.role == manager
|
||||||
|
|
||||||
|
scheduler:
|
||||||
|
image: crazymax/swarm-cronjob:latest
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
environment:
|
||||||
|
- "TZ=Europe/Copenhagen"
|
||||||
|
- "LOG_LEVEL=info"
|
||||||
|
- "LOG_JSON=false"
|
||||||
|
deploy:
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.role == manager
|
||||||
45
TicTacToe/TicTacToe.py
Normal file
45
TicTacToe/TicTacToe.py
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# Tic Tac Toe game in Python
|
||||||
|
|
||||||
|
board = [' ' for _ in range(9)]
|
||||||
|
|
||||||
|
def print_board():
|
||||||
|
row1 = '| {} | {} | {} |'.format(board[0], board[1], board[2])
|
||||||
|
row2 = '| {} | {} | {} |'.format(board[3], board[4], board[5])
|
||||||
|
row3 = '| {} | {} | {} |'.format(board[6], board[7], board[8])
|
||||||
|
|
||||||
|
print()
|
||||||
|
print(row1)
|
||||||
|
print(row2)
|
||||||
|
print(row3)
|
||||||
|
print()
|
||||||
|
|
||||||
|
def check_win():
|
||||||
|
win_conditions = [(0, 1, 2), (3, 4, 5), (6, 7, 8), (0, 3, 6), (1, 4, 7), (2, 5, 8), (0, 4, 8), (2, 4, 6)]
|
||||||
|
for condition in win_conditions:
|
||||||
|
if board[condition[0]] == board[condition[1]] == board[condition[2]] != ' ':
|
||||||
|
return board[condition[0]]
|
||||||
|
if ' ' not in board:
|
||||||
|
return 'Tie'
|
||||||
|
return False
|
||||||
|
|
||||||
|
def game():
|
||||||
|
current_player = 'X'
|
||||||
|
|
||||||
|
while True:
|
||||||
|
print_board()
|
||||||
|
move = input("Player {}, enter your move (1-9): ".format(current_player))
|
||||||
|
if board[int(move) - 1] == ' ':
|
||||||
|
board[int(move) - 1] = current_player
|
||||||
|
result = check_win()
|
||||||
|
if result:
|
||||||
|
print_board()
|
||||||
|
if result == 'Tie':
|
||||||
|
print("It's a tie!")
|
||||||
|
else:
|
||||||
|
print("Player {} wins!".format(result))
|
||||||
|
break
|
||||||
|
current_player = 'O' if current_player == 'X' else 'X'
|
||||||
|
else:
|
||||||
|
print("Invalid move, try again.")
|
||||||
|
|
||||||
|
game()
|
||||||
Reference in New Issue
Block a user