Skip to content

Commit

Permalink
Setup postgres and docker (#4)
Browse files Browse the repository at this point in the history
* Compose and example env file

* Added dockerfile
  • Loading branch information
echang594 authored Oct 18, 2024
1 parent 5f2382d commit c7faf07
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
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

0 comments on commit c7faf07

Please sign in to comment.