diff --git a/code/server/docker-compose.yml b/code/server/docker-compose.yml index 8ca6a49..029be30 100644 --- a/code/server/docker-compose.yml +++ b/code/server/docker-compose.yml @@ -1,13 +1,14 @@ version: 'latest' + services: postgres-db: container_name: notespace-postgres-db build: context: . - dockerfile: ./docker/Dockerfile-db + dockerfile: Dockerfile environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} ports: - - 5432:5432 + - "5432:5432" \ No newline at end of file diff --git a/code/server/docker/Dockerfile-db b/code/server/docker/Dockerfile-db index 47e1ce5..b19c50f 100644 --- a/code/server/docker/Dockerfile-db +++ b/code/server/docker/Dockerfile-db @@ -1,15 +1,8 @@ FROM postgres -USER postgres -WORKDIR /app - -ENV POSTGRES_USER=${POSTGRES_USER} -ENV POSTGRES_PASSWORD=${POSTGRES_PASSWORD} -ENV POSTGRES_DB=${POSTGRES_DB} - COPY sql/create_tables.sql /docker-entrypoint-initdb.d/1_create-schema.sql -COPY --chown=postgres:postgres ./docker/scripts/wait-for-postgres.sh ./bin/wait-for-postgres.sh -RUN chmod +x ./bin/wait-for-postgres.sh +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 -EXPOSE 5432 \ No newline at end of file +EXPOSE 5432 diff --git a/code/server/render.yaml b/code/server/render.yaml index 8d22dd4..98e1341 100644 --- a/code/server/render.yaml +++ b/code/server/render.yaml @@ -1,6 +1,6 @@ services: - name: postgres-db - type: web + type: worker env: docker plan: standard dockerCommand: docker-compose up