Skip to content

Commit

Permalink
fix: Update Dockerfiles and docker-compose.dev.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
peterxcli committed Feb 18, 2024
1 parent a8cbe62 commit 5a1c5c7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Dockerfile_Backend
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ RUN go mod download
RUN CGO_ENABLED=1 GOOS=linux go build -o /app/main ./cmd/backend/main.go

# Runtime Stage
FROM busybox AS runtime
FROM alpine:latest AS runtime
RUN apk --no-cache add ca-certificates

# Copy the binary from the build stage to the runtime stage
COPY --from=build /app/main /app
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile_Notifier
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ RUN go mod download
RUN CGO_ENABLED=1 GOOS=linux go build -o /app/main ./cmd/notifier/main.go

# Runtime Stage
FROM busybox AS runtime
FROM alpine:latest AS runtime
RUN apk --no-cache add ca-certificates

# Copy the binary from the build stage to the runtime stage
COPY --from=build /app/main /app
Expand Down
23 changes: 23 additions & 0 deletions docker/docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,29 @@ services:
# networks:
# - bike-networks

db:
image: postgres:latest
restart: always
environment:
POSTGRES_DATABASE: ${APP_DB_DATABASE}
POSTGRES_USER: ${APP_DB_USERNAME}
POSTGRES_PASSWORD: ${APP_DB_PASSWORD}
ports:
- "5432:5432"
networks:
- bike-networks

redis:
image: redis:latest
restart: always
environment:
TZ: ${APP_SERVER_TIMEZONE}
ports:
- ${APP_REDIS_PORT}:6379
networks:
- bike-networks


pgadmin:
image: dpage/pgadmin4
container_name: bike-pgadmin
Expand Down
6 changes: 3 additions & 3 deletions script/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ case "$action" in
start|stop|teardown)
export_env $mode
if [ "$action" = "start" ]; then
$DOCKER_COMP -f docker/docker-compose.yaml -f docker/docker-compose.${mode}.yaml up -d ${@:3}
$DOCKER_COMP -f docker/docker-compose.${mode}.yaml up -d ${@:3}
elif [ "$action" = "stop" ]; then
$DOCKER_COMP -f docker/docker-compose.yaml -f docker/docker-compose.${mode}.yaml down
$DOCKER_COMP -f docker/docker-compose.${mode}.yaml down
elif [ "$action" = "teardown" ]; then
$DOCKER_COMP -f docker/docker-compose.yaml -f docker/docker-compose.${mode}.yaml down --remove-orphans -v
$DOCKER_COMP -f docker/docker-compose.${mode}.yaml down --remove-orphans -v
echo "*** WARNING ***"
echo "Please run 'sudo rm -rf docker/volumes' by yourself to remove the persistent volumes"
else
Expand Down

0 comments on commit 5a1c5c7

Please sign in to comment.