Official Docker image (#46)
* Initial Dockerfile * Docker added to Readme * Added Docker to Travis
This commit is contained in:
50
.dockerignore
Normal file
50
.dockerignore
Normal file
@@ -0,0 +1,50 @@
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# IDEs
|
||||
/.vscode/
|
||||
/.idea/
|
||||
|
||||
# cypress
|
||||
cypress/videos
|
||||
cypress/screenshots
|
||||
|
||||
# next-pwa
|
||||
**/public/workbox-*.js*
|
||||
**/public/sw.js*
|
||||
**/public/worker-*.js*
|
||||
|
||||
# git
|
||||
.git/
|
||||
.gitignore
|
||||
.gitattributes
|
||||
10
.travis.yml
10
.travis.yml
@@ -7,6 +7,9 @@ os: linux
|
||||
|
||||
dist: xenial
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
@@ -31,3 +34,10 @@ script:
|
||||
else
|
||||
yarn cy:run;
|
||||
fi'
|
||||
|
||||
before_deploy:
|
||||
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
||||
|
||||
deploy:
|
||||
provider: script
|
||||
script: docker push thedaviddelta/lingva-translate
|
||||
|
||||
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
# https://nextjs.org/docs/deployment#docker-image
|
||||
|
||||
FROM node:alpine AS deps
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install --frozen-lockfile
|
||||
|
||||
FROM node:alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
RUN addgroup -g 1001 -S nodejs
|
||||
RUN adduser -S nextjs -u 1001
|
||||
COPY --chown=nextjs:nodejs . .
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
RUN chown nextjs:nodejs .
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENV NODE_ENV production
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED 1
|
||||
|
||||
CMD NEXT_PUBLIC_SITE_DOMAIN=$site_domain yarn build && yarn start
|
||||
@@ -36,6 +36,12 @@ The easiest way is to use their creators' own platform, [Vercel](https://vercel.
|
||||
|
||||
[](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2FTheDavidDelta%2Flingva-translate%2Ftree%2Fmain&env=NEXT_PUBLIC_SITE_DOMAIN&envDescription=Your%20domain)
|
||||
|
||||
There's also an [official Docker image](https://hub.docker.com/repository/docker/thedaviddelta/lingva-translate) available for easing the deployment using Compose, Kubernetes or similar technologies. Remember to also include the environment variable (simplified to `site_domain`) when running the container.
|
||||
|
||||
```bash
|
||||
docker run -p 3000:3000 -e site_domain=lingva.ml thedaviddelta/lingva-translate:latest
|
||||
```
|
||||
|
||||
|
||||
## Instances
|
||||
|
||||
@@ -48,7 +54,6 @@ These are the currently known *Lingva* instances. Feel free to make a Pull Reque
|
||||
| [translate.tixte.gifts](https://translate.tixte.gifts) | [Vercel](https://vercel.com/) | [Let's Encrypt](https://www.ssllabs.com/ssltest/analyze.html?d=translate.tixte.gifts) |
|
||||
|
||||
|
||||
|
||||
## Public APIs
|
||||
|
||||
Nearly all the *Lingva* instances should supply a pair of public developer APIs: a RESTful one and a GraphQL one.
|
||||
|
||||
Reference in New Issue
Block a user