mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 18:26:34 +02:00
Remove DATABASE_URL from Dockerfile (#328)
This commit is contained in:
parent
91a621ecfc
commit
d4bebbc0f2
3 changed files with 15 additions and 9 deletions
|
@ -12,16 +12,14 @@ COPY . .
|
|||
|
||||
RUN yarn build
|
||||
|
||||
FROM node:alpine
|
||||
FROM node:alpine
|
||||
|
||||
ENV PORT 3000
|
||||
EXPOSE 3000
|
||||
|
||||
ARG DATABASE_URL
|
||||
ENV DATABASE_URL $DATABASE_URL
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY --from=build /app .
|
||||
COPY docker_start.sh .
|
||||
|
||||
CMD sh -c "yarn prisma migrate deploy --schema prisma/schema.prisma && yarn start"
|
||||
ENTRYPOINT [ "./docker_start.sh" ]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
version: "3.3"
|
||||
version: "3.9"
|
||||
services:
|
||||
rallly_db:
|
||||
image: postgres:14.2
|
||||
|
@ -7,15 +7,20 @@ services:
|
|||
- db-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
- POSTGRES_DB=db
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
rallly:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
- DATABASE_URL=postgres://postgres:postgres@rallly_db:5432/db?pgbouncer=true
|
||||
restart: always
|
||||
depends_on:
|
||||
- rallly_db
|
||||
rallly_db:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- 3000:3000
|
||||
environment:
|
||||
|
|
3
docker_start.sh
Executable file
3
docker_start.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
yarn prisma migrate deploy --schema prisma/schema.prisma
|
||||
yarn start
|
Loading…
Add table
Reference in a new issue