Skip to content

Commit c470c4d

Browse files
lambtroniuioiua
andauthored
docs: add Docker files (#253)
* add docker files to repo * original suggestions * use latest deno version --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
1 parent 0a80be0 commit c470c4d

4 files changed

Lines changed: 31 additions & 44 deletions

File tree

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
README.md
2+
.example.env
3+
.vscode/
4+
.github/

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM denoland/deno
2+
EXPOSE 8000
3+
WORKDIR /app
4+
ADD . /app
5+
6+
# Add dependencies to the container's Deno cache
7+
RUN deno cache main.ts
8+
CMD ["task", "start"]

README.md

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -208,50 +208,9 @@ AWS Lightsail and Digital Ocean.
208208
2. Create an account on [Docker Hub](https://hub.docker.com), a registry for
209209
Docker container images.
210210

211-
3. Create a `Dockerfile` in the root of your repo:
212-
213-
```docker
214-
FROM denoland/deno:1.32.4
215-
EXPOSE 8000
216-
WORKDIR /app
217-
ADD . /app
218-
219-
# Add dependencies to the container's Deno cache
220-
RUN deno cache main.ts --import-map=import_map.json
221-
CMD ["run", "--allow-run", "--allow-write", "--allow-read", "--allow-env", "--allow-net", "main.ts"]
222-
```
223-
224-
4. Create a `.dockerignore` file in the root folder of your repo to make sure
225-
certain files are not deployed to the docker container:
226-
227-
```dockerignore
228-
README.md
229-
.example.env
230-
.vscode/
231-
.github/
232-
```
233-
234-
5. A `docker-compose.yml` file will be needed to run the docker file on a VPS.
235-
Here’s what that file in your repo's root folder will look like:
236-
237-
```yml
238-
version: '3'
239-
240-
services:
241-
web:
242-
build: .
243-
container_name: deno-sasskit
244-
image: deno-image
245-
environment:
246-
- DENO_DEPLOYMENT_ID=${DENO_DEPLOYMENT_ID}
247-
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
248-
- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
249-
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY}
250-
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
251-
- STRIPE_PREMIUM_PLAN_PRICE_ID=${STRIPE_PREMIUM_PLAN_PRICE_ID}
252-
ports:
253-
- "8000:8000"
254-
```
211+
> Note: the [`Dockerfile`](./Dockerfile), [`.dockerignore`](./.dockerignore) and
212+
> [`docker-compose.yml`](./docker-compose.yml) files come included with this
213+
> repo.
255214
256215
The values of the environmental variables are pulled from the `.env` file.
257216

docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: '3'
2+
3+
services:
4+
web:
5+
build: .
6+
container_name: deno-saaskit
7+
image: deno-image
8+
environment:
9+
- DENO_DEPLOYMENT_ID=${DENO_DEPLOYMENT_ID}
10+
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
11+
- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
12+
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY}
13+
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
14+
- STRIPE_PREMIUM_PLAN_PRICE_ID=${STRIPE_PREMIUM_PLAN_PRICE_ID}
15+
ports:
16+
- "8000:8000"

0 commit comments

Comments
 (0)