Skip to content

Commit

Permalink
fix(Dockerfile): add mongodb env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
arodindev committed Aug 4, 2024
1 parent c7f07e1 commit dd358b4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: publish
on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: docker-login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/${{github.repository_owner}}/todoapp:${{github.ref_name}}

3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ RUN poetry export --without-hashes --without dev -f requirements.txt --output re

FROM python:3.11.6-slim

ENV MONGODB_URL="mongodb://localhost" \
MONGODB_URI="mongodb://mongo:27017"

WORKDIR /todoapp

COPY --from=base /tmp/requirements.txt /todoapp/requirements.txt
Expand Down

0 comments on commit dd358b4

Please sign in to comment.