-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from diegofcornejo/dockerfile
Dockerfile
- Loading branch information
Showing
6 changed files
with
211 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Git | ||
.git | ||
.gitignore | ||
# Node | ||
node_modules | ||
npm-debug.log | ||
# Vercel | ||
.vercel | ||
.cache | ||
.next | ||
out | ||
# Production | ||
build | ||
# Environment | ||
.env | ||
.env.local | ||
.env.development | ||
.env.test | ||
.env.production | ||
.env*.local | ||
# macOS | ||
.DS_Store | ||
# Visual Studio Code | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
FROM public.ecr.aws/docker/library/node:20-alpine as builder | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json package-lock.json ./ | ||
|
||
# RUN \ | ||
# if [ -f package-lock.json ]; then \ | ||
# npm ci; \ | ||
# else \ | ||
# npm install --legacy-peer-deps; \ | ||
# fi | ||
|
||
RUN npm install --legacy-peer-deps | ||
|
||
COPY . . | ||
|
||
# Environment variables must be present at build time | ||
ARG CRON_JOB_SECRET | ||
ENV CRON_JOB_SECRET=$CRON_JOB_SECRET | ||
ARG DISCORD_CLIENT_ID | ||
ENV DISCORD_CLIENT_ID=$DISCORD_CLIENT_ID | ||
ARG DISCORD_CLIENT_SECRET | ||
ENV DISCORD_CLIENT_SECRET=$DISCORD_CLIENT_SECRET | ||
ARG DISCORD_REDIRECT_URI | ||
ENV DISCORD_REDIRECT_URI=$DISCORD_REDIRECT_URI | ||
ARG GITHUB_TOKEN | ||
ENV GITHUB_TOKEN=$GITHUB_TOKEN | ||
ARG JWT_ISSUER | ||
ENV JWT_ISSUER=$JWT_ISSUER | ||
ARG JWT_SECRET | ||
ENV JWT_SECRET=$JWT_SECRET | ||
ARG NEXTAUTH_SECRET | ||
ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET | ||
ARG NEXT_PUBLIC_API_URL | ||
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL | ||
ARG NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT | ||
ENV NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT=$NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT | ||
ARG NEXT_PUBLIC_CACHET_API_URL | ||
ENV NEXT_PUBLIC_CACHET_API_URL=$NEXT_PUBLIC_CACHET_API_URL | ||
ARG NEXT_PUBLIC_ONESIGNAL_APP_ID | ||
ENV NEXT_PUBLIC_ONESIGNAL_APP_ID=$NEXT_PUBLIC_ONESIGNAL_APP_ID | ||
ARG NEXT_PUBLIC_ONESIGNAL_SAFARI_WEB_ID | ||
ENV NEXT_PUBLIC_ONESIGNAL_SAFARI_WEB_ID=$NEXT_PUBLIC_ONESIGNAL_SAFARI_WEB_ID | ||
ARG NEXT_PUBLIC_WEBSOCKET_URL | ||
ENV NEXT_PUBLIC_WEBSOCKET_URL=$NEXT_PUBLIC_WEBSOCKET_URL | ||
ARG NODE_NO_WARNINGS | ||
ENV NODE_NO_WARNINGS=$NODE_NO_WARNINGS | ||
ARG NX_DAEMON | ||
ENV NX_DAEMON=$NX_DAEMON | ||
ARG REDIS_URL | ||
ENV REDIS_URL=$REDIS_URL | ||
ARG SENDGRID_API_KEY | ||
ENV SENDGRID_API_KEY=$SENDGRID_API_KEY | ||
ARG SENDGRID_FROM_EMAIL | ||
ENV SENDGRID_FROM_EMAIL=$SENDGRID_FROM_EMAIL | ||
ARG SENDGRID_PASSWORD_TEMPLATE_ID | ||
ENV SENDGRID_PASSWORD_TEMPLATE_ID=$SENDGRID_PASSWORD_TEMPLATE_ID | ||
ARG SENDGRID_TEMPLATE_ID | ||
ENV SENDGRID_TEMPLATE_ID=$SENDGRID_TEMPLATE_ID | ||
ARG SERVER_API_ADMIN_KEY | ||
ENV SERVER_API_ADMIN_KEY=$SERVER_API_ADMIN_KEY | ||
ARG SERVER_API_URL | ||
ENV SERVER_API_URL=$SERVER_API_URL | ||
|
||
|
||
# Build the app | ||
RUN npm run build | ||
|
||
# Production image | ||
FROM builder as production | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/.next ./.next | ||
COPY --from=builder /app/package.json ./package.json | ||
|
||
EXPOSE 3000 | ||
|
||
ENV PORT 3000 | ||
|
||
CMD HOSTNAME=0.0.0.0 npm run start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: '3.8' | ||
name: evolutionygo | ||
services: | ||
web: | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
CRON_JOB_SECRET: ${CRON_JOB_SECRET} | ||
DISCORD_CLIENT_ID: ${DISCORD_CLIENT_ID} | ||
DISCORD_CLIENT_SECRET: ${DISCORD_CLIENT_SECRET} | ||
DISCORD_REDIRECT_URI: ${DISCORD_REDIRECT_URI} | ||
GITHUB_TOKEN: ${GITHUB_TOKEN} | ||
JWT_ISSUER: ${JWT_ISSUER} | ||
JWT_SECRET: ${JWT_SECRET} | ||
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET} | ||
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL} | ||
NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT: ${NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT} | ||
NEXT_PUBLIC_CACHET_API_URL: ${NEXT_PUBLIC_CACHET_API_URL} | ||
NEXT_PUBLIC_ONESIGNAL_APP_ID: ${NEXT_PUBLIC_ONESIGNAL_APP_ID} | ||
NEXT_PUBLIC_ONESIGNAL_SAFARI_WEB_ID: ${NEXT_PUBLIC_ONESIGNAL_SAFARI_WEB_ID} | ||
NEXT_PUBLIC_WEBSOCKET_URL: ${NEXT_PUBLIC_WEBSOCKET_URL} | ||
NODE_NO_WARNINGS: ${NODE_NO_WARNINGS} | ||
NX_DAEMON: ${NX_DAEMON} | ||
REDIS_URL: ${REDIS_URL} | ||
SENDGRID_API_KEY: ${SENDGRID_API_KEY} | ||
SENDGRID_FROM_EMAIL: ${SENDGRID_FROM_EMAIL} | ||
SENDGRID_PASSWORD_TEMPLATE_ID: ${SENDGRID_PASSWORD_TEMPLATE_ID} | ||
SENDGRID_TEMPLATE_ID: ${SENDGRID_TEMPLATE_ID} | ||
SERVER_API_ADMIN_KEY: ${SERVER_API_ADMIN_KEY} | ||
SERVER_API_URL: ${SERVER_API_URL} | ||
env_file: | ||
- .env | ||
ports: | ||
- "3000:3000" |
Oops, something went wrong.