Skip to content
This repository was archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
docker: fixed dockerfile, k8s incomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
zleyyij committed Jul 24, 2023
1 parent f9e11a7 commit 9049d0f
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 12 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
docs
src
README.md
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
FROM node:20

# Create a directory for everything to be installed, this is the container working dir for future commands
WORKDIR /usr/src/turing-bot
WORKDIR /usr/src/turingbot

COPY package*.json ./
COPY package.json ./package.json

# Install dependancies
RUN npm install --no-audit --omit=dev
RUN npm install --no-audit --omit=dev

# Copy code over
COPY config.jsonc ./config.jsonc
COPY Makefile ./Makefile
COPY target/ ./target/
# # Copy code over
# COPY config.jsonc ./
# COPY Makefile ./
# COPY target/ ./target/
# COPY .git/ ./.git/
COPY . .

# Run it without compiling
CMD ["make", "run"]
CMD ["node", "/usr/src/turingbot/target/core/main.js"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ docker-build: build

# Start a pre-existing docker container in daemon mode
docker-start:
docker run --rm -d turingbot turingbot
docker run --rm -d turingbot

# Make a bot docker container and start it in daemon mode
docker-run: docker-build
Expand All @@ -62,4 +62,4 @@ docker-docs: docs
# --rm removes the container once it's finished running,
# -d means to run in daemon mode, -p 8080:80 indicates that we want to
# take port 80 inside the container and map it to port 8080 on the outside
docker run --rm -d -p 8080:80 --name turingdocs turingdocs
docker run --rm -d -p 8080:80 turingdocs
30 changes: 29 additions & 1 deletion k8s/dev/mongo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@ spec:
- port: 27017
targetPort: 27017
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: slow
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-standard
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongo-volume-claim
spec:
storageClassName: "slow"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 512Mi
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand All @@ -28,8 +48,16 @@ spec:
containers:
- name: mongodb
image: mongo:6.0
args: ['--dbpath','/data/db']
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: root
- name: MONGO_INITDB_ROOT_PASSWORD
value: root
value: root
volumeMounts:
- name: 'mongo-volume-claim'
mountPath: '/data/db'
volumes:
- name: mongo-volume-claim
persistentVolumeClaim:
claimName: 'mongo-volume-claim'
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"version": "0.1.0",
"main": "./core/main.ts",
"type": "module",
"directories": {
"test": "tests"
Expand Down

0 comments on commit 9049d0f

Please sign in to comment.