Last active
June 13, 2023 13:00
-
-
Save slinkardbrandon/200ad96d5705eb0cb138aee6b534285e to your computer and use it in GitHub Desktop.
Serverless in docker example
This file contains hidden or 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
version: '3.7' | |
services: | |
appName: | |
build: { context: . } | |
ports: ['3000:3000', '3002:3002'] |
This file contains hidden or 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
FROM node:12-alpine | |
WORKDIR /app | |
COPY tsconfig.json ./ | |
COPY serverless.yml ./ | |
COPY package.json ./ | |
COPY package-lock.json ./ | |
RUN npm ci | |
COPY . . | |
EXPOSE 3000 | |
EXPOSE 3002 | |
CMD ["node", "./node_modules/serverless/bin/serverless.js", "offline", "start", "--host", "0.0.0.0"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have any issues with connecting to your database with environment variables you also might have to update your connection string in the docker-compose file like so: