Browse Source

init

master
xsiva 3 years ago
commit
fdade685fb
4 changed files with 77 additions and 0 deletions
  1. +1
    -0
      .gitignore
  2. +2
    -0
      README.md
  3. +16
    -0
      apps/cannabinieri_web/Dockerfile
  4. +58
    -0
      docker-compose.yml

+ 1
- 0
.gitignore View File

@ -0,0 +1 @@
acme/acme.json

+ 2
- 0
README.md View File

@ -0,0 +1,2 @@
start:
docker-compose up -d

+ 16
- 0
apps/cannabinieri_web/Dockerfile View File

@ -0,0 +1,16 @@
FROM rust:1.56.1
WORKDIR /usr/src
RUN apt-get update
RUN git clone https://code.basabuuka.org/xsiva/cannabinieri_web_actix.git
RUN apt-get install cargo -y
RUN cargo install --path ./cannabinieri_web_actix/
WORKDIR /usr/src/cannabinieri_web_actix
# RUN cargo install diesel_cli --no-default-features --features "mysql"
# RUN diesel setup
CMD cargo run

+ 58
- 0
docker-compose.yml View File

@ -0,0 +1,58 @@
version: '3.8'
services:
traefik_proxy:
image: traefik:2.5
container_name: traefik_proxy
restart: unless-stopped
security_opt:
- no-new-privileges:true
command:
- "--log.level=DEBUG"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--certificatesresolvers.myresolver.acme.httpchallenge=true"
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.myresolver.acme.email=alexandra.hosp@protonmail.com"
- "--certificatesresolvers.myresolver.acme.storage=acme.json"
ports:
- 80:80
- 443:443
networks:
- proxy
volumes:
- ./acme/acme.json:/acme.json
- /var/run/docker.sock:/var/run/docker.sock:ro
rust_server:
build: ./apps/cannabinieri_web
container_name: rust_server
restart: always
labels:
- "traefik.docker.network=proxy"
- "traefik.enable=true"
# - "traefik.protocol=http"
- "traefik.port=5000"
- "traefik.http.routers.rust_server.entrypoints=websecure"
- "traefik.http.routers.rust_server.tls=true"
- "traefik.http.routers.rust_server.tls.certresolver=myresolver"
- "traefik.http.routers.rust_server.rule=Host(`cyberpreneur.net`)"
environment:
- RUST_BACKTRACE=full
networks:
- proxy
ports:
- "5000:5000"
networks:
proxy:
external: true

Loading…
Cancel
Save