mirror of
https://github.com/demostf/maps.git
synced 2026-06-03 15:34:06 +02:00
docker
This commit is contained in:
parent
25e828d9fb
commit
2517fcd669
3 changed files with 70 additions and 0 deletions
15
.github/workflows/ci.yml
vendored
Normal file
15
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
on: [push, pull_request]
|
||||
|
||||
name: CI
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v20
|
||||
- run: nix build .#docker
|
||||
- name: Push image
|
||||
if: github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
skopeo copy --dest-creds="${{ secrets.DOCKERHUB_USERNAME }}:${{ secrets.DOCKERHUB_TOKEN }}" "docker-archive:$(nix build .#docker --print-out-paths)" "docker://demostf/maps"
|
||||
7
README.md
Normal file
7
README.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# maps
|
||||
|
||||
Map overview images for tf2 maps
|
||||
|
||||
## Usage
|
||||
|
||||
See https://maps.demos.tf
|
||||
48
flake.nix
48
flake.nix
|
|
@ -14,6 +14,7 @@
|
|||
pkgs = import nixpkgs {
|
||||
inherit system overlays;
|
||||
};
|
||||
inherit (pkgs) writeText dockerTools;
|
||||
inherit (pkgs.stdenv) mkDerivation;
|
||||
in rec {
|
||||
packages = rec {
|
||||
|
|
@ -44,6 +45,53 @@
|
|||
cp -r ${images} $out/images
|
||||
'';
|
||||
};
|
||||
nginxConf = writeText "nginx.conf" ''
|
||||
user nobody nobody;
|
||||
daemon off;
|
||||
error_log /dev/stdout info;
|
||||
pid /dev/null;
|
||||
events {}
|
||||
http {
|
||||
include ${pkgs.nginx}/conf/mime.types;
|
||||
access_log /dev/stdout;
|
||||
server {
|
||||
listen 80;
|
||||
autoindex on;
|
||||
charset utf-8;
|
||||
|
||||
location / {
|
||||
root ${maps};
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
docker = dockerTools.buildLayeredImage {
|
||||
name = "demostf/maps";
|
||||
tag = "latest";
|
||||
maxLayers = 5;
|
||||
contents = with pkgs; [
|
||||
nginx
|
||||
fakeNss
|
||||
(writeScriptBin "start-server" ''
|
||||
#!${runtimeShell}
|
||||
nginx -c ${nginxConf};
|
||||
'')
|
||||
];
|
||||
|
||||
extraCommands = ''
|
||||
mkdir -p var/log/nginx
|
||||
mkdir -p var/cache/nginx
|
||||
mkdir -p tmp
|
||||
chmod 1777 tmp
|
||||
'';
|
||||
|
||||
config = {
|
||||
Cmd = ["start-server"];
|
||||
ExposedPorts = {
|
||||
"80/tcp" = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
default = maps;
|
||||
};
|
||||
devShells.default = pkgs.mkShell {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue