Skip to content

Commit

Permalink
Integration with Docker.io image
Browse files Browse the repository at this point in the history
  • Loading branch information
rmaafs committed Nov 17, 2023
1 parent 9c79d4c commit 427eaae
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 📦 Docker Release Push
on:
release:
types: [published]

jobs:
publish:
name: 📦 Build & Push
runs-on: ubuntu-latest
steps:
- name: 👷‍♂️ Set up QEMU
uses: docker/setup-qemu-action@v1

- name: 👷‍♂️ Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: 🔍 Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: 🏷 Get the version
id: get_version
run: |
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: ☁ Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: rmaafs/crypt-me-api:${{ steps.get_version.outputs.VERSION }}
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:14.18-alpine3.12

WORKDIR /app

COPY . .

RUN npm install

EXPOSE 20203

CMD ["npm", "start"]
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3"
services:
crypt-backend:
image: rmaafs/crypt-me-api:latest
ports:
- "20203:20203"
network_mode: bridge
environment:
VIRTUAL_HOST: api-crypt.rmaafs.com
env_file: /root/.env/crypt-me-api/secrets.env
restart: always
3 changes: 3 additions & 0 deletions src/Database.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const LANG_NOT_FOUND =
*/
class Database {
constructor(callbackStartServer) {
if (process.env.MONGO_PATH === undefined || process.env.MONGO_PATH === "") {
throw Error("Please add the environment variable 'MONGO_PATH'.");
}
//Conectamos la base de datos de mongodb
MongoClient.connect(process.env.MONGO_PATH, {
useUnifiedTopology: true,
Expand Down

0 comments on commit 427eaae

Please sign in to comment.