Skip to content

Commit

Permalink
feat: added docker-compose setup (#35)
Browse files Browse the repository at this point in the history
* chore: added log for request object

* fix: api url in form

* chore: updated console log

* feat: enabled vercel analytics

* chore: removed dotenv

* feat: stricter request blocking in production mode

* feat: added docker-compose setup

* fix: formatting errors

* feat: integrated husky
  • Loading branch information
sarthikg authored Jan 10, 2024
1 parent 44894db commit 4a670c1
Show file tree
Hide file tree
Showing 8 changed files with 1,097 additions and 1,075 deletions.
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Sarthik's Portfolio Website",
"dockerComposeFile": "../deployment/dev/docker-compose.yaml",
"service": "app_server",
"workspaceFolder": "/app",
"customizations": {
"vscode": {
"extensions": [
"astro-build.astro-vscode",
"dbaeumer.vscode-eslint",
"ms-vscode.vscode-typescript-next",
"esbenp.prettier-vscode"
]
}
}
}
25 changes: 25 additions & 0 deletions .github/workflows/pr-verification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Inspection & Test
on:
pull_request:
branches:
- "master"
- "release/**"

jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the code on the runner
- uses: actions/checkout@v3
# Install Node.js
- uses: actions/setup-node@v3
with:
node-version: 20
# Install dependencies
- run: npm ci
# Check Formatting
- run: npm run format:check
# Check linting
- run: npm run lint:check
# Run tests
# - run: npm test
18 changes: 18 additions & 0 deletions deployment/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:20

# Set the working dir inside the image
WORKDIR /app

# Copy the startup script & give executable permission
COPY ./deployment/dev /app/deployment/dev
RUN chmod +x /app/deployment/dev/startup-script.sh

# Copy the project dependencies
COPY ./package.json /app
COPY ./package-lock.json /app

# Copy Environment Variables
COPY ./deployment/dev/.env ./.env.development

# Install the packages
RUN npm install
27 changes: 27 additions & 0 deletions deployment/dev/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: "3"
services:
app_server:
build:
context: ../../
dockerfile: ./deployment/dev/Dockerfile
container_name: app_server
ports:
- 4321:4321
volumes:
- ../../:/app
- /app/node_modules
- ~/.ssh:/root/.ssh
- ~/.gitconfig:/root/.gitconfig
command: ["bash", "./deployment/dev/startup-script.sh"]
stdin_open: true
tty: true
mailcatcher:
image: mailhog/mailhog:latest
container_name: mailcatcher
ports:
- 1025:1025
- 1080:8025
environment:
SMTP_PORT: 1025
SMTP_USERNAME: [email protected]
SMTP_PASSWORD: password
9 changes: 9 additions & 0 deletions deployment/dev/startup-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

echo Load Environment Variables
echo "set -o allexport" >> ~/.bashrc
echo "source ./deployment/dev/.env" >> ~/.bashrc
echo "set +o allexport" >> ~/.bashrc
source ~/.bashrc

/bin/bash
Loading

0 comments on commit 4a670c1

Please sign in to comment.