🚦 Added traefik

This commit is contained in:
2021-10-19 07:36:35 -07:00
parent 84e2a10d1b
commit d84b02ef82
2 changed files with 30 additions and 10 deletions

View File

@@ -8,6 +8,10 @@ services:
image: frishi/threetwo image: frishi/threetwo
container_name: threetwo-ui container_name: threetwo-ui
env_file: ./docker-compose.env env_file: ./docker-compose.env
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.threetwo-ui.rule=Host(`threetwo.local`)"
ports: ports:
- "8050:8050" - "8050:8050"
- "3050:3050" - "3050:3050"
@@ -15,7 +19,7 @@ services:
depends_on: depends_on:
- rabbitmq - rabbitmq
- db - db
- nginx - traefik
- importapi - importapi
- import - import
- imagetransformation - imagetransformation
@@ -126,15 +130,31 @@ services:
networks: networks:
- proxy - proxy
nginx:
image: nginx traefik:
container_name: reverse-proxy image: traefik:2.3.4
restart: unless-stopped
container_name: traefik
hostname: traefik
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.watch=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`traefik.localhost`)"
- "traefik.http.routers.traefik.service=api@internal"
networks:
- proxy
ports: ports:
- "80:80" - 80:80
- 8080:8080
- 443:443
volumes: volumes:
- type: bind - /var/run/docker.sock:/var/run/docker.sock
source: ./proxy.conf
target: /etc/nginx/conf.d/default.conf
rabbitmq: rabbitmq:
image: 'bitnami/rabbitmq:latest' image: 'bitnami/rabbitmq:latest'

View File

@@ -15,7 +15,7 @@ export const io = new Server(httpServer, {
cors: { cors: {
origin: "*", origin: "*",
methods: ["GET", "POST"], methods: ["GET", "POST"],
} },
}); });
// configure app to use bodyParser for // configure app to use bodyParser for
@@ -26,7 +26,7 @@ app.use(bodyParser.urlencoded({ extended: true }));
const port: number = Number(process.env.PORT) || 8050; // set our port const port: number = Number(process.env.PORT) || 8050; // set our port
// set rabbitMQ host // set rabbitMQ host
const rabbitMQConnectionString = process.env.RABBITMQ_URI || "amqp://localhost"; const rabbitMQConnectionString = process.env.RABBITMQ_URI || "amqp://localhost:5672";
// Send index.html on root request // Send index.html on root request
app.use(express.static("dist")); app.use(express.static("dist"));