Skip to content

Commit

Permalink
fixed some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
TellToldTold committed Jun 1, 2024
1 parent 403832f commit bfa08b3
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 24 deletions.
12 changes: 12 additions & 0 deletions .env_api
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DATABASE_TYPE=
DATABASE_HOST=
DATABASE_PORT=
DATABASE_USERNAME=
DATABASE_PASSWORD=
DATABASE_NAME=
DATABASE_SYNCHRONIZE=
AUTH0_ISSUER_URL=
AUTH0_AUDIENCE=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=
3 changes: 3 additions & 0 deletions .env_db
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=
4 changes: 4 additions & 0 deletions .env_web
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VITE_AUTH0_DOMAIN=
VITE_AUTH0_CLIENTID=
VITE_AUTH0_AUDIENCE=
VITE_BASE_URL=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ api/src/modules/GAuth/authInfo
/**/dist
/**/*.tsbuildinfo
.vscode
/**/.env*

tmp-*

Expand Down
9 changes: 2 additions & 7 deletions Dockerfile_copy → Dockerfile_api
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY frontend/package.json frontend/
COPY api/package.json api/
COPY shared/package.json shared/

Expand All @@ -26,15 +25,11 @@ COPY . .
RUN pnpm run format-check

# Build the app
RUN pnpm run build
RUN pnpm run build:api

# Expose the port
EXPOSE 3000

ENV PORT 3000
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"

# Start the app
CMD ["pnpm", "dev:api"]
CMD ["pnpm", "preview:api"]

9 changes: 3 additions & 6 deletions Dockerfile → Dockerfile_web
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@ COPY . .
RUN pnpm run format-check

# Build the app
RUN pnpm run build
RUN pnpm run build:web

# Expose the port
EXPOSE 5173

ENV PORT 5173
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"
EXPOSE 5174

# Start the app
CMD ["pnpm", "dev:web"]
CMD ["pnpm", "preview:web"]

9 changes: 9 additions & 0 deletions docker-compose-dbonly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
db:
image: postgres:latest
environment:
- POSTGRES_USER=hkrecruitment
- POSTGRES_PASSWORD=password
- POSTGRES_DB=hkrecruitment
ports:
- '5432:5432'
16 changes: 7 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
services:
db:
image: postgres:latest
environment:
- POSTGRES_USER=hkrecruitment
- POSTGRES_PASSWORD=password
- POSTGRES_DB=hkrecruitment
env_file:
- .env_db
ports:
- '5432:5432'


web:
build:
context: .
dockerfile: Dockerfile
dockerfile: Dockerfile_web
env_file:
- .env
- .env_web
ports:
- '5173:5173'
depends_on:
Expand All @@ -23,10 +21,10 @@ services:
api:
build:
context: .
dockerfile: Dockerfile_copy
dockerfile: Dockerfile_api
env_file:
- .env
- .env_api
ports:
- '3000:3000'
depends_on:
- db
- db
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview --port 5173",
"preview": "vite preview --host --port 5173",
"clean": "rimraf dist",
"format": "prettier --write src",
"format-check": "prettier --check src"
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"dev:api": "pnpm --filter api start:dev",
"dev": "pnpm run --stream dev:web & pnpm run --stream dev:api",
"dev:tmux": "tmux new-session -d -s hkrecruitment 'pnpm run dev:web' \\; split-window -h -p 50 'pnpm run dev:api' \\; attach",
"build:web": "pnpm --filter frontend build",
"build:api": "pnpm --filter api build",
"build": "pnpm --filter frontend build && pnpm --filter api build",
"preview:web": "pnpm --filter frontend preview",
"preview:api": "pnpm --filter api start:prod",
Expand All @@ -21,4 +23,4 @@
"keywords": [],
"author": "",
"license": "ISC"
}
}

0 comments on commit bfa08b3

Please sign in to comment.