Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
test(docker): setup docker env for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainLanz committed Mar 14, 2019
1 parent c581856 commit 5a6c34d
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Localstack

HOSTNAME=localstack-s3
SERVICES=s3:5000
DEFAULT_REGION=us-east-1

S3_KEY=no_need
S3_SECRET=no_need
S3_ENDPOINT=http://localstack-s3:5000
S3_BUCKET=testbucket
S3_REGION=us-east-1

SPACES_KEY=no_need
SPACES_SECRET=no_need
SPACES_ENDPOINT=http://localstack-s3:5000
SPACES_BUCKET=testbucket
SPACES_REGION=us-east-1
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:current-alpine

WORKDIR /app

COPY package.json ./
COPY yarn.lock ./

RUN apk add --no-cache \
python \
make \
gcc \
g++ \
&& yarn

RUN yarn

COPY . .
CMD ["yarn", "run", "test"]
27 changes: 27 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3'
services:
flydrive:
container_name: flydrive
build:
context: .
dockerfile: ./Dockerfile
depends_on:
- localstack-s3
env_file:
- ./.env.testing
volumes:
- .:/app
- /app/node_modules
command: tail -f /dev/null

# Based on http://bluesock.org/~willkg/blog/dev/using_localstack_for_s3.html
# More examples at https://medium.com/@andyalky/developing-aws-apps-locally-with-localstack-7f3d64663ce4
localstack-s3:
container_name: localstack-s3
image: localstack/localstack
env_file:
- ./.env.testing
ports:
- '5000:5000'
- '8080:8080'
restart: on-failure

0 comments on commit 5a6c34d

Please sign in to comment.