You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Click me
Hello everyone I am following the video [[Backend #25] How to write docker-compose file and control service start-up orders with wait-for.sh](https://www.youtube.com/watch?v=jf6sQsz0M1M&ab_channel=TECHSCHOOL), but I can't make it work.
Note: some components, such as, docker images and containers have different names from the course.
echo "RUN DB migration"
/app/migrate -path /app/migration -database "$DB_SOURCE" -verbose up
echo "start the app"
exec ls -la
exec "$@"
Then I run docker compose down and delete my api image. However when I do docker compose up I get this error (in the picture), it might be something that I am not seeing... My files structure is in the second picture
Solved the issue, I was deleting the wrong image
The text was updated successfully, but these errors were encountered:
Click me
Hello everyone I am following the video [[Backend #25] How to write docker-compose file and control service start-up orders with wait-for.sh](https://www.youtube.com/watch?v=jf6sQsz0M1M&ab_channel=TECHSCHOOL), but I can't make it work.Note: some components, such as, docker images and containers have different names from the course.
Thank you for your help!
Here are my files:
docker-compose-yml
version: "3.9"
services:
postgres:
image: postgres:latest
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=simple_bank
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
environment:
- DB_SOURCE=postgresql://root:secret@postgres:5432/simple_bank?sslmode=disable
depends_on:
- postgres
entrypoint: ["/app/wait-for.sh", "postgres:5432", "--", "/app/start.sh"]
command: ["/app/main"]
Dockerfile
#Build Stage
FROM golang:1.19-alpine AS builder
WORKDIR /app
COPY . .
RUN go build -o main main.go
Run stage
FROM alpine
WORKDIR /app
COPY --from=builder /app/main .
COPY /app/migrate ./migrate
COPY app.env .
COPY start.sh .
COPY wait-for.sh .
COPY db/migrations ./migration
EXPOSE 8080
CMD [ "/app/main" ]
ENTRYPOINT [ "/app/start.sh" ]
start.sh
#!/bin/sh
set -e
echo "RUN DB migration"
/app/migrate -path /app/migration -database "$DB_SOURCE" -verbose up
echo "start the app"
exec ls -la
exec "$@"
Then I run docker compose down and delete my api image. However when I do docker compose up I get this error (in the picture), it might be something that I am not seeing... My files structure is in the second picture
Solved the issue, I was deleting the wrong image
The text was updated successfully, but these errors were encountered: