Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup postgres and docker #4

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RDS_HOST=localhost
RDS_PORT=5432
RDS_DATABASE=hackathon_portal
RDS_USER=acmucsd_dev
RDS_PASSWORD=password
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20.18.0 AS build

WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn build

FROM node:20.18.0-alpine3.19
WORKDIR /app
COPY --from=build /app /app
EXPOSE 3000
CMD ["yarn", "release"]
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
rds.acmucsd.local:
container_name: rds.acmucsd.local
image: postgres:17
restart: always
ports:
- '${RDS_PORT}:5432'
environment:
POSTGRES_DB: ${RDS_DATABASE}
POSTGRES_USER: ${RDS_USER}
POSTGRES_PASSWORD: ${RDS_PASSWORD}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"build": "tsc",
"test": "jest --config jest.config.json --runInBand",
"release": "node build/index.js",
"lint": "eslint ./ --ext .ts",
"lint:fix": "eslint ./ --ext .ts --fix"
},
Expand Down
Loading