diff --git a/cache/docker-compose.yml b/cache/docker-compose.yml deleted file mode 100644 index dfecfec..0000000 --- a/cache/docker-compose.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: "3.5" - -services: - cache: - build: . - user: nobody - ports: - - 8000:8000 - restart: always \ No newline at end of file diff --git a/cache/dockerfile b/cache/dockerfile deleted file mode 100644 index 59f44bd..0000000 --- a/cache/dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM node:alpine - -WORKDIR /app -USER nobody -COPY ./app.js ./.key ./ - -ENTRYPOINT [ "node" ] -CMD [ "app.js" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..dedda06 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,36 @@ +version: '3' + +services: + frontend: + image: nginx:alpine + restart: always + ports: + - 80:80 + volumes: + - ./app:/srv + - ./nginx.conf:/etc/nginx/conf.d/default.conf + networks: + - dvb + - traefik + labels: + - traefik.enable=true + - traefik.port=80 + - traefik.backend=dvb + - traefik.frontend.rule=Host:wundtstr.club + + cache: + image: node:alpine + command: node /app.js + volumes: + - ./cache/app.js:/app.js + - ./cache/.key:/.key + ports: + - 8000 + networks: + - dvb + restart: always + +networks: + dvb: + traefik: + external: true \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..f1bb245 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,14 @@ +server{ + listen 80; + server_name _; + + location / { + root /srv; + # Activate the next line if you want to list files + # autoindex on; + } + + location /cache/ { + proxy_pass http://cache:8000/; + } +} \ No newline at end of file