feat: add Docker support
This commit is contained in:
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# .env
|
||||||
|
.env
|
||||||
|
# Database
|
||||||
|
db
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
# ========== Global config ==========
|
# ========== Global config ==========
|
||||||
|
DB_DATA_LOCATION=./db # Relative path in which database should be stored.
|
||||||
|
CURRENT_DIRECTORY_ABSOLUTE_PATH=/path/to/kittyurl/ # Absolute path to current directory. Note the trailing slash.
|
||||||
|
|
||||||
# ============= Backend =============
|
# ============= Backend =============
|
||||||
BACKEND_PORT=6567 # Port on which the backend service should listen to requests.
|
BACKEND_PORT=6567 # Port on which the backend service should listen to requests.
|
||||||
BACKEND_VERSION=latest # Want to use a specific image for backend? Put the branch here followed by a release tag (like master-v1.2.3). Otherwise the latest one will get pulled.
|
BACKEND_VERSION=latest # Want to use a specific image for backend? Put the branch here followed by a release tag (like master-v1.2.3). Otherwise the latest one will get pulled.
|
||||||
|
ACCESS_TOKEN_PRIVATE_KEY=CHANGE_ME_TO_SOMETHING_RANDOM # Used to generate user tokens. Make sure this is pretty random.
|
||||||
|
TRUSTED_ORIGINS=http://localhost:6568,http://127.0.0.1:6568 # Comma separated list of trusted origins. Make sure to include your PUBLIC_URL here.
|
||||||
|
PATH_TO_WORDLIST=kittyBE/wordlist.example-large.ts # Relative path (considering CURRENT_DIRECTORY_ABSOLUTE_PATH) to wordlist to use when generating URLs. Note there is no slash at start.
|
||||||
|
|
||||||
# Postgres and TypeORM
|
# Postgres and TypeORM
|
||||||
PG_USER=kitty
|
PG_USER=kitty
|
||||||
@@ -21,3 +25,6 @@ DEBUG=false # Set to `false` to disable some features not mea
|
|||||||
# ============ Frontend ============
|
# ============ Frontend ============
|
||||||
FRONTEND_PORT=6568 # Port on which the frontend service should listen to requests.
|
FRONTEND_PORT=6568 # Port on which the frontend service should listen to requests.
|
||||||
FRONTEND_VERSION=latest # Want to use a specific image for frontend? Put the branch here followed by a release tag (like master-v1.2.3). Otherwise the latest one will get pulled.
|
FRONTEND_VERSION=latest # Want to use a specific image for frontend? Put the branch here followed by a release tag (like master-v1.2.3). Otherwise the latest one will get pulled.
|
||||||
|
|
||||||
|
VITE_API_TARGET=http://localhost:6567 # The backend API base URL you want to use.
|
||||||
|
VITE_ALLOWED_HOST=example.com # Hosts allowed when visiting frontend. Probably should match PUBLIC_URL (tweak this when running a reverse proxy). To allow subdomains, add a dot (.) before the host address (vite.dev/config/server-options#server-allowedhosts).
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
# .env
|
# .env
|
||||||
.env
|
.env
|
||||||
|
# Database
|
||||||
|
db
|
||||||
|
|||||||
@@ -6,16 +6,18 @@
|
|||||||
name: kittyurl
|
name: kittyurl
|
||||||
services:
|
services:
|
||||||
|
|
||||||
# kittyfe:
|
kittyfe:
|
||||||
# container_name: frontend
|
container_name: frontend
|
||||||
# image: gitea.7o7.cx/kittyteam/kittyfe:${FRONTEND_VERSION:-latest}
|
image: gitea.7o7.cx/kittyteam/kittyfe:${FRONTEND_VERSION:-latest}
|
||||||
# env_file:
|
env_file:
|
||||||
# - .env
|
- .env
|
||||||
# ports:
|
ports:
|
||||||
# - ${FRONTEND_PORT}:6568
|
- ${FRONTEND_PORT}:6568
|
||||||
# depends_on:
|
depends_on:
|
||||||
# - kittybe
|
- kittybe
|
||||||
# restart: unless-stopped
|
volumes:
|
||||||
|
- ${CURRENT_DIRECTORY_ABSOLUTE_PATH}.env:/.env
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
kittybe:
|
kittybe:
|
||||||
container_name: backend
|
container_name: backend
|
||||||
@@ -26,6 +28,11 @@ services:
|
|||||||
- ${BACKEND_PORT}:6567
|
- ${BACKEND_PORT}:6567
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
|
volumes:
|
||||||
|
# Change me if you want to store wordlist somewhere else.
|
||||||
|
# Remember, Docker requires you to point out absolute path when mounting
|
||||||
|
# only a single file.
|
||||||
|
- ${CURRENT_DIRECTORY_ABSOLUTE_PATH}${PATH_TO_WORDLIST}:/app/src/tools/wordlist.ts
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
@@ -38,4 +45,6 @@ services:
|
|||||||
POSTGRES_USER: ${PG_USER}
|
POSTGRES_USER: ${PG_USER}
|
||||||
POSTGRES_PASSWORD: ${PG_PASS}
|
POSTGRES_PASSWORD: ${PG_PASS}
|
||||||
POSTGRES_DB: ${PG_DB}
|
POSTGRES_DB: ${PG_DB}
|
||||||
|
volumes:
|
||||||
|
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
|
||||||
|
shm_size: 128mb
|
||||||
|
|||||||
2
kittyBE
2
kittyBE
Submodule kittyBE updated: 58460d988d...dfc3f4cd87
2
kittyFE
2
kittyFE
Submodule kittyFE updated: 686ed0340e...447ea1c761
Reference in New Issue
Block a user