forked from okteto/compose-getting-started
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
2,100 additions
and
2 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,6 @@ | ||
*.pyc | ||
project.lock.json | ||
bin/ | ||
obj/ | ||
.vs/ | ||
node_modules/ |
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 |
---|---|---|
@@ -1,2 +1,34 @@ | ||
# stack-getting-started | ||
A sample repo to getting started with Okteto Stacks | ||
# Getting Started on Okteto with Stacks | ||
|
||
This example shows how to leverage [Okteto](https://github.com/okteto/okteto) to deploys the Voting App in Kubernetes using Okteto Stacks. | ||
|
||
<!-- This is the application used for the [How to Develop and Debug PHP Applications in Kubernetes](https://okteto.com/blog/how-to-develop-php-apps-in-kubernetes/) blog post. --> | ||
|
||
The Voting App is a simple distributed application running across multiple containers. Containers are implemented using Python, Node.js and Java, with Redis for messaging and Postgres for storage. | ||
|
||
 | ||
|
||
* A front-end web app in [Python](/vote) which lets you vote between two options. | ||
* A [Redis](https://hub.docker.com/_/redis/) queue which collects new votes. | ||
* A [Java](/worker/src/main) worker which consumes votes and stores them in... | ||
* A [Postgres](https://hub.docker.com/_/postgres/) database backed by a volume. | ||
* A [Node.js](/result) webapp which shows the results of the voting in real time. | ||
|
||
|
||
## Deploy the Voting App | ||
|
||
``` | ||
okteto stack deploy | ||
``` | ||
|
||
## Deploy the Voting App rebuilding containers | ||
|
||
``` | ||
okteto stack deploy --build | ||
``` | ||
|
||
## Destroy the Voting App | ||
|
||
``` | ||
okteto stack destroy | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
okteto: true | ||
services: | ||
vote: | ||
public: true | ||
image: okteto/vote:1 | ||
build: vote | ||
replicas: 2 | ||
env: | ||
- OPTION_A=Cats | ||
- OPTION_B=Dogs | ||
ports: | ||
- 80 | ||
|
||
result: | ||
public: true | ||
image: okteto/result:1 | ||
build: result | ||
command: node server.js | ||
ports: | ||
- 80 | ||
|
||
worker: | ||
image: okteto/worker:1 | ||
build: worker | ||
|
||
db: | ||
image: postgres:9.4 | ||
ports: | ||
- 5432 | ||
volumes: | ||
- /var/lib/postgresql/data | ||
|
||
redis: | ||
image: redis:alpine | ||
ports: | ||
- 6379 |
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 @@ | ||
node_modules/ |
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,19 @@ | ||
FROM node:10-slim | ||
|
||
WORKDIR /app | ||
|
||
RUN npm install -g nodemon | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm ci \ | ||
&& npm cache clean --force \ | ||
&& mv /app/node_modules /node_modules | ||
|
||
COPY . . | ||
|
||
ENV PORT 80 | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["node", "server.js"] |
Oops, something went wrong.