Skip to content

Commit

Permalink
Bugfix - Fix Dockerfile for production
Browse files Browse the repository at this point in the history
The dockerfile didn't copy the dialogflow directory so Ote wasn't able to work :(
  • Loading branch information
hanschrome committed Mar 21, 2023
1 parent 618d49a commit 12e288e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build-deploy-docker.yml
Expand Up @@ -14,12 +14,13 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Decode SSH key
run: echo "${{ secrets.SSH_PRIVATE_KEY }}" | base64 --decode > id_rsa
- name: Add SSH key
uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ github.workspace }}/id_rsa
env:
SSH_PRIVATE_KEY_BASE64: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
echo "$SSH_PRIVATE_KEY_BASE64" | base64 --decode > id_rsa
chmod 600 id_rsa
ssh-agent sh -c 'ssh-add id_rsa; git clone git@github.com:solidjobs/ote-dialogflow-client.git dialogflow'
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
Expand Down
8 changes: 2 additions & 6 deletions docker/prod/Dockerfile
Expand Up @@ -6,18 +6,14 @@ RUN npm install -g @angular/cli@8.3.3
COPY . /app
RUN ng build --prod
COPY htaccess/_pro dist/.htaccess
COPY dialogflow dist/dialogflow
RUN mkdir dist/api
COPY profile_image.php dist/api/index.php

FROM php:7.1 AS php_build
RUN apt-get update && apt-get install -y git
WORKDIR /app
RUN mkdir -p /root/.ssh && \
chmod 700 /root/.ssh && \
ssh-keyscan github.com >> /root/.ssh/known_hosts && \
echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa && \
chmod 600 /root/.ssh/id_rsa
RUN git clone git@github.com:solidjobs/ote-dialogflow-client.git dist/dialogflow
COPY --from=node_build /app/dist/dialogflow /app/dist/dialogflow
WORKDIR /app/dist/dialogflow
RUN php composer.phar install

Expand Down

0 comments on commit 12e288e

Please sign in to comment.