Skip to content

Commit

Permalink
Dockerfile Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
R1c4rdCo5t4 committed Jul 9, 2024
1 parent fbcc750 commit c99477c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 2 additions & 3 deletions code/server/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
version: 'latest'

services:
postgres-db:
container_name: notespace-postgres-db
build:
context: .
dockerfile: Dockerfile
dockerfile: ./docker/Dockerfile-db
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
- 5432:5432
13 changes: 10 additions & 3 deletions code/server/docker/Dockerfile-db
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
FROM postgres

USER postgres
WORKDIR /app

ENV POSTGRES_USER=admin
ENV POSTGRES_PASSWORD=notespace
ENV POSTGRES_DB=notespace

COPY sql/create_tables.sql /docker-entrypoint-initdb.d/1_create-schema.sql

COPY --chown=postgres:postgres ./docker/scripts/wait-for-postgres.sh /usr/local/bin/wait-for-postgres.sh
RUN chmod +x /usr/local/bin/wait-for-postgres.sh
COPY --chown=postgres:postgres ./docker/scripts/wait-for-postgres.sh ./bin/wait-for-postgres.sh
RUN chmod +x ./bin/wait-for-postgres.sh

EXPOSE 5432
EXPOSE 5432
2 changes: 1 addition & 1 deletion code/server/render.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
- name: postgres-db
type: worker
type: web
env: docker
plan: standard
dockerCommand: docker-compose up
Expand Down

0 comments on commit c99477c

Please sign in to comment.