Skip to content

Commit

Permalink
chore: add docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
amphineko committed Jan 8, 2024
1 parent 5c3f30a commit b9b0137
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
!/packages/**
!/raddb/**
!/scripts/**
!/package.json
!/tsconfig.json
!/yarn.lock
24 changes: 18 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ ENV \

RUN \
apt-get update && \
apt-get install -y --no-install-recommends eapoltest freeradius freeradius-utils
apt-get install -y --no-install-recommends eapoltest freeradius freeradius-utils && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN mkdir -p /data /var/run

Expand All @@ -22,9 +24,19 @@ COPY \
./raddb/sites-enabled/inner-tunnel \
${RADDB}/sites-enabled/

COPY \
./common \
./supervisor \
/app/

WORKDIR /app

COPY package.json yarn.lock /app/
COPY ./packages/common/package.json /app/packages/common/
COPY ./packages/supervisor/package.json /app/packages/supervisor/
COPY ./packages/web/package.json /app/packages/web/

RUN \
yarn install --frozen-lockfile --production && \
yarn cache clean

COPY . /app/

RUN \
yarn web:build

36 changes: 36 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: "3"

services:
supervisor:
image: "ghcr.io/amphineko/yonagi"
build:
context: "."
dockerfile: "Dockerfile"
command: ["/app/scripts/supervisor.sh"]
entrypoint: ["/bin/sh"]
environment:
LISTEN_PORT: "8000"
LISTEN_HOST: "0.0.0.0"
expose:
- "8000/tcp"
ports:
- "1812:1812/udp"
restart: "unless-stopped"
volumes:
- "./data:/data"
web:
image: "ghcr.io/amphineko/yonagi"
build:
context: "."
dockerfile: "Dockerfile"
command: ["web:start"]
entrypoint: ["/usr/local/bin/yarn"]
environment:
SUPERVISOR_HOST: "http://supervisor:8000"
depends_on:
- "supervisor"
ports:
- "3000:3000/tcp"
restart: "unless-stopped"
volumes:
- "./data:/data"

0 comments on commit b9b0137

Please sign in to comment.